test: replace render source freezes

This commit is contained in:
Erik 2026-08-18 14:58:25 +02:00
parent c31a9ac411
commit 5a33369074
7 changed files with 425 additions and 345 deletions

View file

@ -38,12 +38,12 @@ pwsh ./tools/audit-test-inventory.ps1
The generated JSON lives under ignored `artifacts/test-audit/`; it is not a
second 6.8 MB checked-in source of truth. The script and this reviewed ledger
are durable, while paths and line numbers regenerate after every batch. The
inventory refreshed through Batch U reports:
inventory refreshed through Batch W reports:
| Syntax signal | Current count |
|---|---:|
| Tracked/parsed C# test files | 1,256 / 1,256 |
| Attributed test methods (not expanded theory cases) | 11,447 |
| Tracked/parsed C# test files | 1,254 / 1,254 |
| Attributed test methods (not expanded theory cases) | 11,416 |
| Exact duplicate-data rows | 0 |
| Reviewed body-equivalent groups / methods | 11 / 27 |
| Methods containing at least one empty `return;` | 138 |
@ -56,7 +56,7 @@ inventory refreshed through Batch U reports:
| Methods directly using `Thread.Sleep` / `Task.Delay` | 15 / 14 |
| Cancellable-infinite-only / elapsed-time methods | 5 / 24 |
| Methods directly reading environment variables | 47 |
| Methods directly / through same-file helpers reading `.cs` source text | 67 / 107 |
| Methods directly / through same-file helpers reading `.cs` source text | 63 / 98 |
The three remaining prerequisite-return candidates are all reviewed branch
false positives: the two Windows/Linux factory assertions and the launcher's
@ -140,7 +140,7 @@ identifiable in the lane report.
| T-009 wall-clock double-click tests | resolved in batch E | Four sleeps were replaced by a deterministic test clock behind an internal factory overload. The production factory still reads `Environment.TickCount64` exactly as before. |
| T-010 two useless cases | high-confidence cleanup batch A | Delete `SmokeTest.TestProject_IsWired` and `ChaseCameraTests.ImplementsICamera`; compilation already proves both claims. |
| T-011 diagnostic-only methods | resolved in batches C, L, and R | The reviewed current set is 82 methods / 103 cases. All carry `Purpose=Diagnostic`, preserving the apparatus while removing it from release pass totals. Batch R catches investigations whose only assertion validates fixture/DAT availability, which the original mechanical output-only scan could not distinguish from an oracle. |
| T-012 source-text freezes | direct-read map completed in batch I, helper-mediated gap corrected in batch U, and staged replacement approved | Seventeen whole-tree architecture rules and five cross-artifact contracts stay. The other 85 are literal implementation or test-model freezes; approval authorizes retiring each only beside its semantic/behavioral replacement. |
| T-012 source-text freezes | direct-read map completed in batch I, helper-mediated gap corrected in batch U, and staged replacement active | Seventeen whole-tree architecture rules and five cross-artifact contracts stay. Batch W retires the first nine literal implementation freezes beside stronger behavior or compiled-metadata evidence; 76 staged replacements remain. |
| T-013 controller self-comparison | high-confidence cleanup batch A | Capture the first controller next to the first body and compare every retry with that reference. |
| T-014 seven load-sensitive tests | six mechanisms repaired in batch F; one product defect classified | Virtual/wall-clock mixing, tiered-JIT allocation noise, a live controller clock, and a ThreadPool-start timing oracle were removed without weakening behavioral contracts. `DatSoundCache` #321 is a real in-flight-entry race and now runs as `Status=KnownFailure` pending a product fix. |
| T-015 four non-prerequisite skips | resolved in batches A/B | PVS scaffold deleted with rationale preserved; redundant chat/radar generators deleted in favor of the comprehensive Manual lane; tower oracle is `Status=KnownFailure`. |
@ -1027,3 +1027,61 @@ Verification:
and
- the no-retry complete hermetic Release gate passes 14,351/14,351 with zero
skips or failures across all 12 test assemblies, exactly 28 below Batch U.
## Batch W render delegation and cleanup source-freeze replacement
Batch W retires the first nine of the 85 approved implementation-text freezes
without changing product code. Six test methods now inspect runtime behavior,
reflection metadata, or compiled call/new-object edges; three redundant source
tests are removed because an existing behavioral trace already asserts the
same contract more strongly.
The exact decisions are:
- `TextRendererConstructorOwnsExactlyOneDeviceResource` no longer counts
constructor strings. `TextRendererConstructionCreatesAndDisposesOnlyOnePipeline`
constructs the real renderer through `RecordingGpuDevice`, proves that only
one pipeline is added (no buffer, texture, sampler, or texture slot), and
proves that exact pipeline is disposed. The V4a/V6d rollback rationale stays
beside the test. The recording device gained read-only created-resource lists
solely so tests can observe those device calls.
- `Renderer_source_preserves_retail_stage_order_through_typed_operations` is
removed. The existing outdoor and interior `DrawInside` tests already drive
the real renderer and assert the typed operation sequence, including early
and late landscape, particle flush, interior clear, masks, shells, and entity
routes.
- `Production_uses_retained_routes_without_rebuilding_legacy_partition` is
removed. The existing production-product test is renamed to state this
contract and continues to prove one actual retained candidate with zero
compare-only referee work. Exact private selector spellings are not a product
oracle.
- `Production_builder_preserves_the_frame_preparation_order` is removed. The
existing builder test already supplies recording implementations of every
typed source and asserts the complete call order plus the borrowed result.
- executor reset/diagnostic bracketing, the one-executor/one-PView composition,
lighting snapshot-before-UBO order, typed world-frame build, local frame-root
composition, and GameWindow delegation now inspect compiled call/new-object
edges and reflected owner fields. `CompiledCallGraph` is shared test-only
infrastructure that parses the built method body; formatting, comments, local
variable names, and source paths cannot satisfy or break these contracts.
Two mixed source assertions were deliberately narrowed rather than silently
carried forward. Absence of `Console.WriteLine` is an implementation-style
check with no output oracle and is not treated as render behavior. The old
world-scene source test also embedded a separate teardown-order claim; that
claim remains with the dedicated lifetime suite and is reconciled in the
approved host/lifetime replacement batch instead of coupling teardown to frame
construction.
Verification:
- the four directly affected App suites pass 39/39;
- the complete locked Release build covers all 44 projects with zero warnings
and zero errors;
- the no-retry complete hermetic Release gate passes 14,348/14,348 with zero
skips or failures across all 12 test assemblies; the exact three-case
reduction is the three redundant source tests above; and
- the regenerated 1,254-file inventory parses every file and reduces direct
source readers from 67 to 63 and total direct/helper readers from 107 to 98.
The remaining 98 reconcile to the 22 approved retained policies/contracts
and 76 staged replacements.