Masked pixel twins are booked: warm --used and the prefetch can make them #3974
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3974
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3974"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@danielsteman on GitHub · 2026-11-30 13:19 UTC · original
danielsteman:fix/known-book-masked-twins→main· +104 −3 · 2 files · 3 commits · openFixes #3860.
A draw under the console's sample mask uses its pixel shader's masked twin (
Shader::masked), which is a pipeline with its own key.host_pipeline_maskedmade the twin throughmade_or_startbut never noted it in the known-pipeline book. The book also could not tell the twin from its plain pipeline: an entry stores a stage and the container's hash, and the twin shares the plain shader's container. Sowarm --usedand the recipe prefetch had nothing to build the twin from.Change
host_pipeline_maskednotes the twin withknown::noteand passes it throughmake::adopt, ashand_outdoes for a plain pipeline. Withoutadopt, a twin the in-run prefetch had already started from its recipe sat unused inPREFETCHED, and the draw made the twin a second time.Book::notesetsMASKED = 0x80in a masked pixel shader's stage byte inknown-pipelines.bin, andparserestores.masked()from that bit. If the bit is on any stage other than pixel,parsedrops that entry.known-shaders.binis unchanged: each container is stored once, under its plain stage.This is the stage-flag option the reporter proposed. A build from before this change skips a flagged entry by the stage table's bounds check and still reads the rest of the book. SergDi and andrewpozdnakov7-jpg each tested that on Windows against
41adb551(see the issue thread).Tests
a_masked_twin_comes_back_masked: a vertex/pixel pipeline and its twin, noted in either order, each come back with their own key. Each container is written once, under its plain stage.a_mask_bit_on_a_stage_other_than_pixel_is_not_read: a book with the bit on a vertex stage loses only that entry.I wrote this on macOS.
cargo clippy --target x86_64-pc-windows-msvc -p victory-gpu --all-targetsgives no new diagnostics: the 24 warnings invictory-gpuare already on main, and so are the 3 lint errors invictory-shader. The tests arecfg(windows), so I rancargo test -p victory-gpu --libonwindows-latestin my fork's CI, beforemake::adoptwas added; that commit has not been run on Windows. Clippy shows no new warnings for either commit when cross-compiled. Both new tests passed, along with the rest ofpipeline::known(7/7). Overall 923 passed and 1 failed. The failure isshader_cache::tests::every_switch_of_the_translator_is_in_the_key("VICTORY_SCALAR_SPLITS is not read by the translator any more"), which is in code this PR does not touch. The full CI Clippy step also fails on main, on an unusedunwind_copyinvictory-loader/src/crash.rs. I did not check an end-to-endwarm --usedrun.Co-authored-by: SergDi (prototype and pixel-only check)
🤖 Generated with Claude Code
@tyr0nsur on GitHub · 2026-11-30 13:41 UTC · original
I ran the Windows known-book tests at
4228850d. All 7 passed, including both new masked-entry cases.I found one remaining gap in the online prefetch path. The recipe worker calls
make::adopt, buthost_pipeline_maskedwraps its ownPendingin a freshArc. At the first masked draw,made_or_starttherefore sees a different task even when prefetch already created the same key. That can queue duplicate work or fall back to the plain pipeline while the separately queued task finishes.The follow-up routes the masked draw through the same
make::adoptpath as the ordinary pipeline. The new Windows regression checks that the masked key is distinct from the plain key and that the first masked draw selects the exact prefetched task. It failed on pointer identity before the fix and passed after it. The patched pipeline suite passed 74 tests with 2 fixture-dependent tests ignored in each run, once on the RTX 4060 and once under WARP. I did not run the title or an end-to-endwarm --usedworkload.The tested cherry-pick is based directly on this PR.
@dyshay on GitHub · 2026-11-30 14:53 UTC · original
Merged for testing into our integration branch dyshay/VIctory-NVIDIA
janus-prs. Builds and the targeted CPU tests pass; a run on an RTX 4090 (Series S, hardware RT) is queued and I'll post the result here.@danielsteman on GitHub · 2026-11-30 15:01 UTC · original
Thanks. The
make::adoptfollow-up is in as66bb0ac2. I merged main in8fce73f4: main movedBook::noteonto the byte-budgetedPendingqueue, and the masked twin'sMASKEDbit now goes on that queue's pipeline stage byte. I couldn't build it off Windows. Could you re-run the known-book and pipeline tests at8fce73f4?@andrewpozdnakov7-jpg on GitHub · 2026-11-30 15:16 UTC · original
@danielsteman, I reran the Windows tests on the exact
8fce73f4merge head. The known-book suite passed 16/16, including both masked stage-byte tests. It passed 14/14 on current release mainc71899d.I also exercised the actual
host_pipeline_maskedpath with a synthetic pixel-shader pair and a prefetched task. On main, the first masked draw created a different pending object. At8fce73f4, the first draw took the exact prefetched object and the next draw reused it again. The probe checks pending-object identity and returns before compiler submission.The full
pipeline::suite with WARP 1.0.22 and Agility 1.620.2 came to 104 passed / 2 ignored on main and 107 passed / 2 ignored at the PR head. The PR count includes the two masked book cases and the identity probe. Both builds had the same temporary #4018 unit-test build fix.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.