Closed
Labels
enhancementNew feature or request
Description
Part of #2382.
Status
- Keep one deterministic fresh-WAL race in the default suite and move additional rounds behind
MAKA_STORAGE_STRESS=1. Completed in perf(test): keep one deterministic WAL race in the default suite #2459. - Investigate repeated writes in the execution-boundary capacity test. No change needed: the repetitions are required by the 64 KiB per-request limit and 1 MiB cumulative limit.
- Reduce oversized legacy Plan fixtures used to test bounded projection.
Remaining problem
The legacy Plan projection tests use oversized fixtures to cross bounded-projection limits. Determine the smallest fixtures that still prove truncation and lifecycle behavior.
Relevant tests are in packages/storage/src/__tests__/sqlite-workflow-store.test.ts, including:
projects a pre-bound legacy Plan ledger into the bounded Host contractrequires a projected legacy proposal to be revised or abandoned
Outcome
- Use the smallest legacy Plan fixture that reliably crosses each asserted projection boundary.
- Preserve truncation and projected-legacy lifecycle assertions.
- Include comparable timing for any fixture reduction.
Disposition
The execution-boundary capacity test should remain unchanged. Reaching the 1 MiB cumulative boundary requires multiple requests because each request is independently capped at 64 KiB; avoiding that would require an unjustified test-only production seam.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
perf(test): keep one deterministic WAL race in the default suite (#2459)
jackwener commentedon Aug 7, 2026
Partial disposition, and one bullet in this issue turns out to rest on a wrong premise.
Done: the WAL race rounds (bullet 3)
allows concurrent operational owners to initialize the same fresh WAL databaseran its two-process race 12 times. One round already asserts the contract — two owners racing to initialize the same fresh database both succeed, and the result is a WAL database at the current schema version. The extra rounds re-roll the scheduler hoping for a rarer interleaving, which is stress coverage, not contract coverage.They now sit behind
MAKA_STORAGE_STRESS=1, the gateroot-authority.test.tsandgit-workspace-service.test.tsalready use, so there is one stress route rather than a flag per file.Measured with
node --test dist/__tests__/sqlite-recovery-concurrency.test.js:MAKA_STORAGE_STRESS=1Landed in #2459.
Not done, and I do not think it should be: capacity amplification (bullet 1)
Repeated writes to reach a capacity limit points at
rejects an expansion atomically before the complete boundary exceeds capacity— the slowest single test in the suite at 4201ms. Its repetition is forced by the contract, not excess:MAX_SANDBOX_BOUNDARY_FILESYSTEM_ENTRIES = 32— entries per requestMAX_SANDBOX_BOUNDARY_PATH_CHARS = 4096— chars per pathMAX_SANDBOX_BOUNDARY_SERIALIZED_BYTES = 64 KiB— serialized bytes per requestMAX_EXECUTION_BOUNDARY_SERIALIZED_BYTES = 1 MiB— cumulative boundary1 MiB ÷ 64 KiB means at least 16 settles are required to reach the shared cap, and the existing fixture (32 × 1800 chars ≈ 60 KiB per request) is already sitting just under the per-request ceiling. I tried collapsing it into two large requests and was rejected first by the 32-entry limit and then by the 64 KiB per-request limit.
The only way to shorten it is to give the store a test-only injectable cap. That is a test backdoor in production code, added to satisfy a premise that is itself incorrect, so I have not done it. Happy to be overruled if the maintainers weigh it differently.
The cost is also inherent rather than wasteful: each settle re-serializes the whole accumulated boundary, so reaching a 1 MiB cap is quadratic by construction.
Not investigated yet
Oversized legacy Plan fixtures used to test bounded projection — I have not located the specific test. Not claiming it.
Also checked and not worth a change on performance grounds:
foreign-session-store.test.tsseeds 120 threads to cross aLIMITboundary, and the whole test costs 39.9ms. There is a separate, non-performance argument for deriving that count fromFOREIGN_SESSION_SCAN_MAX_SESSIONS(hardcoding it means the test silently stops proving anything if the constant rises), but that is test-correctness, not amplification, and does not belong to this issue.GabrielDrapor commentedon Aug 8, 2026
I'll take this one. Plan per the issue's outcome list:
Will include before/after timing for each PR.
GabrielDrapor commentedon Aug 8, 2026
Both PRs are up:
sqlite-recovery-concurrency.test.ts(whose 12-round amplification perf(test): keep one deterministic WAL race in the default suite #2459 already gated behindMAKA_STORAGE_STRESS) intoSTORAGE_STRESS_FILES, so CI re-enables the amplified rounds when the recovery race surface changes.Two findings from sizing the capacity tests, for the record:
CONNECTION_CATALOG_MAX_ENABLED_MODEL_IDS×CONNECTION_MODEL_ID_MAX_LENGTH, so ~16 commits is the floor for the 4 MiB document cap.MAX_SECRET_LENGTH(64 KiB) and the provider auth contract requires one connection per stored secret, so 32 commits is the floor for the 2 MiB cap. Its per-iteration connection creation is required, not amplification.All three capacity loops break on first rejection, so their loop caps were never a cost driver — the wins came from entry-count reduction (boundary scans) and the Plan fixture.
perf(test): shrink storage capacity and legacy Plan fixtures to minim…
ci(test): auto-enable storage stress rounds for WAL recovery race cha…