Preserve divergent-loop scalar results across 32-lane waves #299
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!299
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-299"
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?
@loyodea on GitHub · 2026-11-26 19:28 UTC · original
loyodea:victory-divergent-loop-translation→main· +125 −53 · 3 files · 1 commits · openRelated to #259.
On an eligible 32-lane host, scalar values read after a divergent console wave64 loop could come from different final iterations in the two halves. Route eligible single-console-wave compute groups through the existing synchronized split console flow when a divergent loop leaves a scalar value live after exit. If that lowering is refused, propagate the refusal so the translator cannot silently return the incorrect per-half results for the selected cases.
This addresses the two scalar-count cases. #276 and #260 address fixture selection and adapter capability handling.
Validation
WaveSize(32), the original scalar results differed by half (32and64, then8and16). Production translation with this patch returned64and16respectively in every lane. Both focused fixtures passed independent reruns with DXIL validation.victory-shaderlibrary suite returned 277 passed and six ignored. With stock lowering restored, both focused regressions failed the explicit wave-size assertion.Codex contributed the implementation, independent review, and verification.
victory replay --retranslatealways translates for a 64-lane RDNA host, whateverVICTORY_HOST_WAVE/VICTORY_HOST_RDNAsay #302@fladit123 on GitHub · 2026-11-26 20:33 UTC · original · approved these changes
Independent physical NVIDIA validation of PR #299.
Both targeted regression tests pass on an RTX 4060 8 GB.
Environment:
lanes_min: 32, lanes_max: 32Revisions:
4f62c2a5e27e7beebf3e8d68f77898e43dc7b77cbe1f933e87d3d2f5b6a6afe17db1f296e2d58615I also performed two negative controls using the candidate's updated fixtures with only
lower.rsrestored from the baseline.The first control failed both explicit DXIL wave-size assertions (
Noneinstead ofSome(32)).For the second control, I replaced only that assertion with diagnostic output, allowing execution to proceed through GPU dispatch and readback. Both original incorrect scalar results were reproduced.
This isolates the effect of the production lowering change from the updated test fixtures.
All four negative-control executions failed as expected. Both unmodified candidate tests passed.
The physical NVIDIA validation therefore supports this correction for the two tested cases.
Full-suite, gameplay and
a-publiercompatibility remain unverified.AI-assisted source review and experimental design using OpenAI ChatGPT. All tests were executed locally on physical NVIDIA hardware.
@ANDREANIADS on GitHub · 2026-11-26 21:16 UTC · original
Confirmed on an RTX 3070 (621.40): both scalar fixtures at
be1f933ereturned the expected count in all 64 lanes. I also tested an incremental patch that routes the two remaining mask fixtures through the normal emitter and adds a 5 + 23 bit regression. All five fixtures passed on hardware. The before/after results and build differences are in the #259 report.The ZIP contains
patches/pr299-mask-tests.patch, which applies directly to this PR head, plus the exact test logs.VIctory-correcao-RTX3070.zip
@gut0to on GitHub · 2026-11-27 15:02 UTC · original · reviewed
AI-assisted static review; I traced the new split-wave eligibility check and the existing fixtures. I did not run the test suite.
@ -12261,0 +12288,4 @@fn split_loop_needs_scalars(&self) -> bool {// An address-based dispatch can exit some threads before the first// barrier. Resource waterfall loops are also lane-local.if !matches!(self.s.threads, Some(threads) if threads.iter().product::<u32>() > 32)@gut0to on GitHub · 2026-11-27 15:02 UTC · original
AI-assisted static review: the new eligibility boundary is
threads > 32, but the existing divergent-loop fixtures use 64 threads. Could the fixture builder cover both 32 and 33 threads? The 33-thread case exercises the first partially populated upper host wave, while the 32-thread control verifies the single-wave boundary.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.