Repository navigation
Conversation
…them (D3D12-WARM-MASKED-TWINS) Since 65f372c the first draw under the console's sample mask builds its masked twin (the pixel shader translated to discard the masked-out pixels) before it is recorded, and the frame waits for that compile. The precompile never made a twin: `known-pipelines.bin` held only the title's own pipelines, so the twin's key, which the used list (`early-pipelines.txt`) does name, had no entry for `leonida warm --used` to make. Every twin was compiled in play, once per translation or driver, a stall each. The twin is now noted in the book the first time a draw asks for it, under its own key. In its entry the pixel shader's stage number carries 0x80 and the mask's position row (u32::MAX for none) follows the hash; reading such an entry makes the shader's masked twin again, so the warm translates and builds the same pipeline the draw would. Entries are length-prefixed: an older build reading a new file refuses only the twins' entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The recorded masked twin rebuilt in a fresh process on both adapters. I tested A synthetic graphics pipeline exercised the production I applied current #2654 ( Cross-reading the books also behaved as described. The new reader made the plain entry from the older book. The older reader made the plain entry from the new book and declined only the masked entry. The three stock book tests passed. The fixture substituted DXC-compiled HLSL at the shader-translation boundary. It did not issue a draw or measure game stalls. MEASURED with synthetic inputs, OpenAI Codex and independent raw-log verification. |
|
Verified on-disk compatibility across an upgrade, rollback, and second upgrade on Windows. I built separate test executables from base Base wrote one plain record. The PR appended two masked records interleaved with two ordinary ones. Base reopened the same files, skipped precisely the two masked entries, and decoded each following plain record. A separate base process then appended a sixth ordinary record. When the PR reopened the book it decoded all six IDs in order, including both masks (no position row and row 3 respectively) and the ordinary record appended after rollback. All five runs also checked the shader container bytes read from disk. This verifies record compatibility and append behavior. Driver compilation and in-game frame times were outside this check. Coordination claim. AI-assisted with OpenAI Codex (GPT-6). |
|
Retail run of the three steps from the description, at Rig: Ryzen 5 5600X (6 cores), 32 GB DDR4-3600, RTX 5070 Ti 16 GB, driver 621.40, Windows 11 Pro 26300. Series X profile, the title's own upscaler, 16:9, story save, the same cache folder throughout. Steps:
From the logs (
Frame pacing (frame-time log, 5 s windows): frames over 1 s: 48 in run 1, 48 in run 2. Frames over 100 ms: 369 and 871 (run 2 was longer and went through busier places). Window-title fps: median 14 in both, p90 14 and 28. This machine is CPU-bound (GPU about 20–30 % busy), so the hitches are not mainly pipeline compiles here, and these numbers neither confirm nor rule out a pacing gain. No crash in either run; both windows were closed normally. AI-assisted (Claude Code). Numbers from my own runs; no logs or game data attached. |
Claimed in the coordination issue as: D3D12-WARM-MASKED-TWINS (#2570 (comment))
What and why
Since 65f372c ("gpu: honor coverage on the first masked draw"), the first draw under the console's sample mask builds its masked twin before the draw is recorded (
make::masked_for), so the frame waits for that compile. This is correct for the picture. But the precompile never makes a twin:library::note_used), so it is inearly-pipelines.txt;known-pipelines.binholds only the title's own pipelines (known::noteis called fromhand_outalone), soleonida warm --usedhas no entry for that key.As a result, every twin is compiled in play, once per translation or driver change, and each one stalls the frame. On a fork that had merged 65f372c this showed up as constant hitching right after an update. Reverting the commit there removed the hitching.
This change:
host_pipeline_maskednotes the twin in the book (known::note) when it is first created, under the twin's own key, the one the used list names.0x80set on its stage number, followed by the mask's position row after the hash (u32::MAXforNone).parsemakesShader::maskedwith that mask, so the warm translates and builds the same pipeline the draw would.STAGES.getmisses); all other entries are unaffected. Old files read as before.Not covered: a twin made for differing bound formats (
make::variant) is noted as used under the variant's key, which the book does not hold. The plain pipelines' format variants have the same gap today.Tested
pipeline::known::tests::a_masked_twin_comes_back_masked: writes an entry with a masked pixel shader (position rowSome(3)andNone) and reads it back with the mask intact; an entry cut inside the position row is refused. Onmainthis test does not build (put_shaderis new), andmain'sparserefuses the0x81stage byte.cargo test -p leonida-gpu --lib --locked: 644 passed, 1 failed (watch::tests::what_the_kernel_writes_through_is_not_guarded_for_another_view, a file this PR does not touch). That test passed when run alone right after.scripts/build-nvidia.ps1(diag, with DLSS) builds.GPUs tested: NVIDIA GeForce RTX 5080, driver 621.40, Windows 11 Pro 26200 (unit tests only so far)
AI-assisted: yes. Claude Code with Claude Opus 5.5 wrote the change. Not yet reviewed by a separate reviewer agent; that will happen before this leaves draft.
Checklist
mainand merges cleanly.check_no_game_data.pyon the changed files).docs/design.md(n/a: no translator change).🤖 Generated with Claude Code