Repository navigation
Shaders: track every incoming edge of a lane-mask phi - #385
nathanbzrr wants to merge 1 commit into
Conversation
|
Thanks @nathanbzrr for this lane-mask phi fix. I tested head Result: 1 passed, 0 failed (75 filtered out). The synthetic shader test exercises a lane-mask phi join with multiple incoming edges and checks the resulting values. It validates the translator’s modeled case, not execution in a title. |
|
Tested Offline,
Every join refusal is gone. 24 more compute programs translate; 70 programs now stop at In the world, pixel shader AI-assisted (Claude Code, Claude Opus 5.5); no game data. |
|
Tested offline against main
|
|
Measured on the full retail shader pack (26,503 containers) with
|
|
In-game data on where the pixel program named in this PR's description sits in a frame, from a run on Windows 10 with an RTX 3070. The short version: it draws into the HDR scene target the final image is built from, and that target is empty. Setup: What I captured: I saved every render target of one frame in the world with
About merging with #439's stack: the pixel program still fails with that reason on the stack above. #439's stack has its own handling for masks that start as a constant ( @nathanbzrr @r4tedx if a version of this fix lands on top of #439's stack (or #439 takes this case), I can run the same capture and say whether that HDR target fills. I'm testing with Claude's help, and Claude drafted this comment. |
|
@walterwallaceson, the 34 dropped draws give us a specific way to check an integration: first see whether the pipeline for AI-assisted (Codex). |
|
@walterwallaceson @nullmarsh, one detail changes what’s worth testing next. The RX 9060 XT report already follows If either of you has the local shader inspection handy, could you report the opcode at AI-assisted (Codex). |
|
@walterwallaceson @nullmarsh, I traced the failing pixel shader locally. At the join reported at I pushed a capture branch at That gets us to the capture you offered: on the same scene and the rest of your original stack, do the formerly dropped draws now execute, and does the RGBA16F target change? I have checked pipeline creation here. I haven’t measured writes to the title’s HDR target. No game data attached. AI-assisted (Codex). |
catminou4
left a comment
There was a problem hiding this comment.
Test-merge with current main (ffe310e) conflicts — needs a rebase. Main moved recently (PR #566 waterfall loops touched lower.rs/resource.rs/valu_tests.rs), so shader PRs opened before it need rebasing. I'll re-review once it merges cleanly.
|
Follow-up on the capture branch at
All 27 gains are pixel programs. Matching programs by source container hash, none that validated on #439 fails on the branch. Refusals fell by 27 in total. The largest drops were Local title data was used for this comparison; only counts, refusal reasons and hashes are reported here. This doesn't answer the HDR-target question. That still needs the in-game capture. AI-assisted (Claude Code). |
|
@r4tedx The in-game capture, on your base: #439
Your base lacks #346: 983 indirect rectangle-list draws dropped on So your fix makes these draws run, but the dump shows no change from them or from #346. Not checked: their inputs, later writes, or correctness (qntic's #298 report). AI-assisted (Claude Code, Claude Opus 5.5); no game data. |
|
@nullmarsh, thanks. This is the A/B the capture branch was for, and it settles one part. On What that means for the PRs:
If your trace can show, for one of the 252 draws, which views are bound and whether those resources hold nonzero data at that point, that would separate the two cases. Also, are 324 and 252 the same four frames counted the same way? Or does the scene issue fewer of these draws on No new tests for this reply. My earlier check of AI-assisted (Claude Code). |
|
@r4tedx Your two questions, from dump runs on
Not known: which views b375 samples; texture-UAV writes (the trace names buffer UAVs only). Next: the same run with #305. AI-assisted (Claude Code, Claude Opus 5.5); no game data. |
|
@r4tedx Follow-up with #305 (
An end-of-frame dump can't tell "never wrote" from "cleared later", and their 64-bit image writes aren't visible to my trace. This base has no #587. AI-assisted (Claude Code, Claude Opus 5.5); no game data. |
|
@nullmarsh, thanks. That's the run I was about to prepare a branch for, so I've dropped mine. Two things follow from it:
I haven't run either of them on this base. The title was not used for this reply. AI-assisted (Claude Code). |
|
Tested the predecessor tracking at In The authored |
42fd559 to
c1bfb02
Compare
c1bfb02 to
7420237
Compare
|
Rebased onto 1. Whole-mask & cross-lane reads after a per-lane join (
|
7420237 to
a3defec
Compare
|
Updated
Verification (
|
|
Code review and RTX 5090 + WARP + DXIL verification at head
Solid fix and welcome |
|
From a tester working with Claude (AI-assisted, Claude Code): an offline check of this PR over a whole title's shader pack (25,889 distinct containers through
Not run: your GPU tests, and the title in a game run. Translation only. |
|
@nathanbzrr I found a case outside the phi-edge tests where the same console-wave scan matters. A Wave32 compute shader uses I put a standalone patch directly on your head. It checks both sources in reachable compute blocks. Inline zero and all-ones still work at any host wave size. The new select regression covered nine 32-lane readbacks, including a scalar input with only bit 31 set and git fetch https://github.com/steven-seagull27/VIctory.git refs/heads/codex/pr385-direct-select-mask
git cherry-pick 1c73d188cb19e1ff8d0598124972ba897ed94e80
cargo test --locked -p victory-shader --lib direct_select_uses_this_lanes_mask_bit -- --nocaptureFor the merge overlap with #2967, there is also a combined branch that preserves both PR histories and #171's signed carry fix. Your per-edge For wider coverage I also ran the combined production change with the carry regression. The library suite stopped at the heap-texture test tracked in #2571. Excluding that one test gave 321 passed, 3 ignored and the same two stride failures and gather failure seen on this host. The final targeted run included both new regressions and the saved-EXEC refusal control. AI-assisted. All tests used synthetic shader inputs. |
Rebased onto main, reconciled with uniform/per-lane mask-data joins, and turned `fill_phis` into a fixpoint loop (`fill_mask_phis` + `fill_data_phis`) so a loop mask phi materialized later by a uniform data join is always populated instead of emitting an empty `phi i1` (thanks to @tyr0nsur for identifying this bug). Also align `mask_uses_console_lanes` with `lower.rs` by filtering unreachable predecessors via `st.reach` and checking `st.other` on `v_cndmask_b32` selectors.
a3defec to
9099742
Compare
Addresses the
a lane-mask join of an untracked masktranslation failure category listed in #293 (3 shaders / ~66 dropped draws and dispatches per frame, including compute2561af9577c47289and pixelb37565055f2f7d3b).Problem
When a lane-mask
Phimerges a tracked mask with a constant or scalar-built mask (for example an exit-mask or accumulator phi initialized to0before a branch/loop, or reset to a constant on a back edge),structurepreviously failed witha lane-mask join of an untracked maskinstead of tracking every incoming edge of the phi.What changed
crates/victory-shader/src/structure.rs:Structured::phi_masksviaPhiJoinandLanes::{derived_phis, phi_joins, phi_join_ids}.joinsandphi_joinsinLanes::check_joins, propagating derived status until fixpoint before buildingphi_masksinfinish().crates/victory-shader/src/emit/lower.rs:pending_masksbeforedata_phisinLower::fill_phisusingStructured::phi_masks.console_lanesthroughphi_masks(includingv_cndmask_b32andv_*_co_ci_u32selects) when an incoming edge needs lane-bit extraction of a constant/scalar mask.flags::WAVE_OPSinLower::lane_bit.Relation to other PRs
structureandemit::loweracross shader stages and both Wave32 and Wave64.Tests (synthetic GFX10 only, no game files)
crates/victory-shader/src/structure.rs:mask_phi_joining_constant_and_compare_records_edge_boolsloop_mask_accumulator_from_zero_tracks_phi_and_edgesloop_mask_phi_reset_to_constant_on_back_edgecrates/victory-shader/src/emit/lower.rs:lane_mask_phi_joining_zero_and_compare_lowerswave64_loop_mask_accumulator_from_zero_lowerslane_mask_phi_with_partial_constant_enables_console_lanescrates/victory-shader/src/emit/valu_tests.rs:lane_mask_phi_joins_execute_correctly(viabuild_wave32_cs/dispatch_wave32), testing branch join with zero, partial constant mask enablingconsole_lanes, and loop mask accumulation - validated withdxil.dlland executed on both hardware GPU and WARP.a345127:rustfmt --edition 2024 --checkcleancargo clippy -p victory-shader --all-targetsclean (0 warnings)cargo test --workspace(271 passed, 0 failed, 4 ignored)151 files ok)Not verified
No game files. AI-assisted; reviewed and verified with the tests above.