docs(workflow): add P1 Gate 1 foundation implementation task specs
This commit is contained in:
1 parent
196ed251f9
commit
8d28c7e3c4
5 files changed
+179
No files matched your search
@@ -0,0 +1,37 @@
|
||||
# Core Standalone UUID, Checked Bits, and Portable Hash
|
||||
Task IDs: M-CORE-02, M-CORE-03
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-02, C-05
|
||||
|
||||
## 1. Context and baseline
|
||||
`include/Void/Core/Uuid.hpp` currently includes `<Void/Math/Random.hpp>` (an undeclared dependency leak violating C-01), allocates temporary `std::string` objects in `parse()` and `v5_lite()`, and marks `v4()` unconditionally `noexcept`. `include/Void/Core/Bits.hpp` lacks checked boundary variants, and `include/Void/Core/Hash.hpp` uses `__builtin_memcpy` in `murmur3_32`.
|
||||
|
||||
## 2. Deliverables
|
||||
- Portable incremental/constexpr extensions in `include/Void/Core/Hash.hpp`.
|
||||
- Zero-Math, zero-allocation `Uuid` APIs in `include/Void/Core/Uuid.hpp`.
|
||||
- `include/Void/Core/CheckedBits.hpp` (`checked_extract`, `checked_deposit`, `checked_align_up`, `checked_align_down`).
|
||||
- Expanded unit tests in `tests/standalone/Core/{Uuid,Bits,Hash}.cpp` and isolated installed consumer `tests/package/CoreOnly`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `include/Void/Core/Hash.hpp`: `fnv1a64_offset_basis`, `fnv1a64_update`, `crc32_initial`, `crc32_update`, `crc32_finalize`; endian-portable `constexpr` `murmur3_32`.
|
||||
- `include/Void/Core/Uuid.hpp`: remove `<Void/Math/Random.hpp>` and `<format>`; add `GenerateError`, `v4(G&)`, `try_v4() noexcept`, throwing `v4()`, `constexpr format_chars`, `constexpr` zero-alloc `parse`, zero-alloc byte-identical `v5_lite`.
|
||||
- `include/Void/Core/CheckedBits.hpp`: `BitError { invalid_range, invalid_alignment, overflow }`, `checked_extract`, `checked_deposit`, `checked_align_up`, `checked_align_down`.
|
||||
- `tests/package/CoreOnly/{CMakeLists.txt,main.cpp}`, `tests/package/InstalledComponents.cmake`.
|
||||
|
||||
## 4. Edge cases
|
||||
- `checked_extract`/`checked_deposit`: `offset = width`, `count = 0`, `count = width`, `offset + count` integer overflow.
|
||||
- `checked_align_up`: `alignment = 0`, non-power-of-two, `value = MAX` overflow.
|
||||
- `Uuid::v5_lite`: golden byte-for-byte equivalence with 1.x `ns.bytes + name` hash output.
|
||||
- Throwing custom URBG propagates out of `v4(G&)`; `try_v4()` converts `random_device` failure without returning nil.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- `-DVOID_ENABLED_MODULES=Core -DVOID_ENABLE_TESTING=OFF` installs and runs `CoreOnly` with all external packages disabled and no `Math` dependency.
|
||||
- Core tests pass with `-DVOID_WARNINGS_AS_ERRORS=ON` and ASan/UBSan.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c cmake -S . -B /tmp/void-p1-core -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Core;Testing" -DVOID_WARNINGS_AS_ERRORS=ON
|
||||
dev cpp-gcc -c cmake --build /tmp/void-p1-core --parallel 4
|
||||
dev cpp-gcc -c /tmp/void-p1-core/tests/VoidTests --filter "Uuid*|Bits*|Hash*"
|
||||
```
|
||||
@@ -0,0 +1,39 @@
|
||||
# Functional Compact Status, Bounded Contexts, and Error Adapters
|
||||
Task ID: M-FUNCTIONAL-02
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-02, C-05 (G-ERROR)
|
||||
|
||||
## 1. Context and baseline
|
||||
`include/Void/Functional/Error.hpp` stores free-form message strings and unbounded `shared_ptr<const Error>` chains with recursive destruction and no machine-readable classification.
|
||||
|
||||
## 2. Deliverables
|
||||
- `ErrorKind`, `ErrorCode`, `Status`, reserved domain constants, bounded message/frame/format limits, and iterative `~Error()` in `include/Void/Functional/Error.hpp`.
|
||||
- `fail(Status)` and `fail(ErrorKind, ...)` factories in `include/Void/Functional/Result.hpp`.
|
||||
- `include/Void/Functional/Adapters.hpp` (`adapt`, `try_invoke`, `from_errno`).
|
||||
- `tests/standalone/Functional/ErrorStatus.cpp`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `include/Void/Functional/Error.hpp`:
|
||||
- `ErrorKind`: `invalid_argument`, `not_found`, `conflict`, `cancelled`, `timeout`, `overloaded`, `unsupported`, `io`, `corrupt`, `exhausted`, `internal`.
|
||||
- `Status { ErrorKind kind; ErrorCode code; }` and `explicit Error(Status) noexcept` (zero heap allocation).
|
||||
- Limits: `kDefaultMaxErrorFrames = 16`, `kDefaultMaxErrorMessageBytes = 1024`, `kDefaultMaxFormattedErrorBytes = 16 * 1024`.
|
||||
- `with_context()` preserves root `Status` and `std::error_code`, pins the root cause at the tail when capping > 16 frames, and sets `truncated() == true`.
|
||||
- `include/Void/Functional/Result.hpp`: typed `fail(...)` overloads.
|
||||
- `include/Void/Functional/Adapters.hpp`: `adapt`, `try_invoke`, `from_errno`.
|
||||
|
||||
## 4. Edge cases
|
||||
- `Error(Status)` makes zero heap allocations.
|
||||
- `try_invoke` must ALWAYS rethrow `std::bad_alloc` and any exception where `map_exception` returns `std::nullopt`.
|
||||
- `adapt` handles `void`, move-only values, and never invokes `map_error` on success.
|
||||
- 20-layer context chains preserve `ErrorKind`, `ErrorCode`, `system_code`, and root cause message.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- Existing 1.x `Result*` tests pass unchanged; `ErrorStatus` suite passes under `-Werror` and ASan/UBSan.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c cmake -S . -B /tmp/void-p1-functional -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Functional;Testing" -DVOID_WARNINGS_AS_ERRORS=ON
|
||||
dev cpp-gcc -c cmake --build /tmp/void-p1-functional --parallel 4
|
||||
dev cpp-gcc -c /tmp/void-p1-functional/tests/VoidTests --filter "ErrorStatus*|Result*"
|
||||
```
|
||||
@@ -0,0 +1,35 @@
|
||||
# Math Span-Safe Parsing, Checked Cast, and Portable Overflow
|
||||
Task ID: M-MATH-02
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-02, C-05, C-07
|
||||
|
||||
## 1. Context and baseline
|
||||
`include/Void/Math/Numeric.hpp` currently passes `string_view::data()` to `std::strtol`/`std::strtod` (unsafe on non-NUL-terminated substrings), uses `long long`-based `in_range`/`narrow_cast` (broken for unsigned 64-bit / floating conversions), and lacks `checked_cast`, `checked_mul_add`, and portable non-builtin overflow arithmetic.
|
||||
|
||||
## 2. Deliverables
|
||||
- Extended `include/Void/Math/Numeric.hpp`: `Error::Inexact`, `Error::NonFinite`, `Rounding`, `kMaxNumericTokenBytes = 256`, guarded `__builtin_*_overflow` + portable `constexpr` fallback, `checked_mul_add`, `checked_cast`, `parse_integer`, `parse_real`, and span-safe `parse_int`/`parse_double` adapters.
|
||||
- Comprehensive boundary tests in `tests/standalone/Math/Numeric.cpp`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `include/Void/Math/Numeric.hpp`:
|
||||
- `checked_cast<To, From>(value, Rounding mode = Rounding::exact) noexcept -> std::expected<To, Error>` across all non-`bool` arithmetic pairs.
|
||||
- `parse_integer<T>(std::string_view, int base = 10) noexcept -> std::expected<T, Error>`.
|
||||
- `parse_real<T>(std::string_view) noexcept -> std::expected<T, Error>`.
|
||||
- `checked_mul_add<T>(T a, T b, T c) noexcept -> std::expected<T, Error>`.
|
||||
|
||||
## 4. Edge cases
|
||||
- Non-NUL-terminated substrings adjacent to digits (`"429"` sliced to `"42"` must parse `42`, never `429`).
|
||||
- `parse_integer`/`parse_real` reject empty strings, `> 256` bytes, leading whitespace, leading `'+'`, trailing characters, and `"nan"`/`"inf"`.
|
||||
- Float->int checks exact exclusive `2^63` (`9223372036854775808.0`) / `2^64` (`18446744073709551616.0`) boundaries, and `nearest_even` implements deterministic ties-to-even independent of `FE_ROUND`.
|
||||
- Int->float exactness checks significant bits without UB when negating `INT64_MIN`; preserves `-0.0` sign on float narrowing.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- Existing `Numeric` tests plus all boundary tests pass under `-Werror` and ASan/UBSan.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c cmake -S . -B /tmp/void-p1-math -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Math;Testing" -DVOID_WARNINGS_AS_ERRORS=ON
|
||||
dev cpp-gcc -c cmake --build /tmp/void-p1-math --parallel 4
|
||||
dev cpp-gcc -c /tmp/void-p1-math/tests/VoidTests --filter "Numeric*"
|
||||
```
|
||||
@@ -0,0 +1,32 @@
|
||||
# Time Injected Clocks and Bounded Stopwatch
|
||||
Task ID: M-TIME-02
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-04, C-05
|
||||
|
||||
## 1. Context and baseline
|
||||
`include/Void/Time/Stopwatch.hpp` hardcodes `std::chrono::steady_clock::now()`, grows `laps_` without bound, and lacks `resume()`. No injectable `MonotonicClock` / `CivilClock` / `ManualClock` interface exists yet for deterministic testing or Async deadlines.
|
||||
|
||||
## 2. Deliverables
|
||||
- `include/Void/Time/Clock.hpp` (`MonotonicClock`, `CivilClock`, `SystemMonotonicClock`, `SystemCivilClock`, `ManualClock`, `ManualCivilClock`, `remaining_until`).
|
||||
- Updated clock-injectable, bounded `Stopwatch` (`resume`, single-sample `split`, `try_lap` capped at 4,096) and `ScopedTimer` clock overload in `include/Void/Time/Stopwatch.hpp`.
|
||||
- `tests/standalone/Time/Clock.cpp` and deterministic tests in `tests/standalone/Time/Stopwatch.cpp`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `include/Void/Time/Clock.hpp`: atomic nanosecond storage in `ManualClock`/`ManualCivilClock`, checked `advance` (`negative_step`, `overflow`), monotonic `set` in `ManualClock`, `remaining_until(clock, deadline)`.
|
||||
- `include/Void/Time/Stopwatch.hpp`: `StopwatchError { not_running, lap_limit_reached }`, `kDefaultMaxLaps = 4096`, borrowed `MonotonicClock` constructors, `resume()`, `try_lap()`, single-sample `split()`, legacy `lap()` compatibility.
|
||||
|
||||
## 4. Edge cases
|
||||
- `ManualClock::advance` with negative duration or `INT64_MAX` overflow leaves time unchanged and returns `ClockError`.
|
||||
- `Stopwatch::start() -> stop() -> advance(clock) -> resume()` preserves prior elapsed & laps without counting stopped idle time.
|
||||
- `try_lap()` at `max_laps_` returns `lap_limit_reached` without growing `laps_`.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- Existing sleep-based `Time`/`Stopwatch` tests pass; deterministic `ManualClock` tests run with zero sleeps under `-Werror`.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c cmake -S . -B /tmp/void-p1-time -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Time;Testing" -DVOID_WARNINGS_AS_ERRORS=ON
|
||||
dev cpp-gcc -c cmake --build /tmp/void-p1-time --parallel 4
|
||||
dev cpp-gcc -c /tmp/void-p1-time/tests/VoidTests --filter "Clock*|Stopwatch*|Time*"
|
||||
```
|
||||
@@ -0,0 +1,36 @@
|
||||
# NEW Memory Subsystem Core Allocators and Resources
|
||||
Task IDs: S-MEMORY-02, S-MEMORY-03, S-MEMORY-04
|
||||
Phase: P1
|
||||
Status: APPROVED
|
||||
Contracts: C-01, C-04, C-05
|
||||
|
||||
## 1. Context and baseline
|
||||
No `src/Memory` module or `include/Void/Memory` headers exist yet. Containers and future IO/Storage modules need bounded PMR budget tracking, bump arenas with checkpoints/typed destructor scopes, and fixed-size block pools.
|
||||
|
||||
## 2. Deliverables
|
||||
- `src/Memory/module.cmake` (`INTERFACE`, depending only on `Core`).
|
||||
- `include/Void/Memory/{Resource.hpp,BudgetResource.hpp,Arena.hpp,BlockPool.hpp}`.
|
||||
- `tests/standalone/Memory/{BudgetResource.cpp,Arena.cpp,BlockPool.cpp}`.
|
||||
- `tests/package/MemoryOnly/{CMakeLists.txt,main.cpp}` wired into `tests/package/InstalledComponents.cmake`.
|
||||
|
||||
## 3. Exact files and interfaces
|
||||
- `Resource.hpp`: `AllocationError`, `UnlimitedTag`/`unlimited`, `ResourceStats`, `is_valid_alignment`.
|
||||
- `BudgetResource.hpp`: atomic CAS `std::pmr::memory_resource` with reservation rollback on upstream `std::bad_alloc`, overflow detection, zero-limit positive rejection.
|
||||
- `Arena.hpp`: fixed, growing, and initial+growing modes (`64 KiB` slab, `1 MiB` geometric cap, `16 MiB` default max), address-aligned bump allocation (explicit 1-byte reservation for 0-byte calls), `Checkpoint`/`rewind`/`reset` with generation checks, `TypedScope` (reverse dtor order, exception-safe `emplace`, 4,096 default registrations), `ArenaResource`.
|
||||
- `BlockPool.hpp`: per-slab intrusive free lists (zero allocations on `deallocate`, safe `trim_idle` of completely idle slabs, default 4,096 blocks / 16 MiB cap) and `SynchronizedBlockPool`.
|
||||
|
||||
## 4. Edge cases
|
||||
- Over-aligned (`alignas(64)`) allocation inside a misaligned/stack fixed buffer aligns the actual pointer address rather than only the offset.
|
||||
- Stale checkpoint after `reset()` returns `invalid_checkpoint`; `reset()`/`rewind()` while a `TypedScope` is live returns `live_allocations`.
|
||||
- `BlockPool::trim_idle()` never touches slabs with live blocks and maintains intact per-slab free lists.
|
||||
|
||||
## 5. Acceptance criteria
|
||||
- Standalone `-DVOID_ENABLED_MODULES=Memory -DVOID_ENABLE_TESTING=OFF` installs and runs `MemoryOnly` with zero external packages.
|
||||
- All Memory tests pass under ASan/UBSan and `-Werror`.
|
||||
|
||||
## 6. Verification commands
|
||||
```sh
|
||||
dev cpp-gcc -c cmake -S . -B /tmp/void-p1-memory -G Ninja -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DVOID_ENABLED_MODULES="Memory;Testing" -DVOID_WARNINGS_AS_ERRORS=ON
|
||||
dev cpp-gcc -c cmake --build /tmp/void-p1-memory --parallel 4
|
||||
dev cpp-gcc -c ctest --test-dir /tmp/void-p1-memory --output-on-failure --timeout 60
|
||||
```
|
||||
Reference in new issue
Block a user