[pr-fix][shaders] Route 'no wave32 lowering' into the retry ladder #123

Open
CRCODE22 wants to merge 1 commit from CRCODE22/Darner:fix/issue-66-wave32-retry-ladder into main
First-time contributor

Programs in WIDE_SKIP_DEFAULT (like CS_TemporalResolve1_Alpha, hash 34992f2b65a789a5) were refused with no wave32 lowering for this wave64 program, but the retry ladder in emit_strict never opened for them because needs_every_lane() did not recognise that message. The folded form with ordered LDS (which the test refused_programs_fold_with_ordered_lds promises) was never tried at runtime. Add the message to needs_every_lane() in emit/lower/analysis.rs so the ladder opens and the exact forms can be taken. Fixes #66

Programs in WIDE_SKIP_DEFAULT (like CS_TemporalResolve1_Alpha, hash 34992f2b65a789a5) were refused with no wave32 lowering for this wave64 program, but the retry ladder in emit_strict never opened for them because needs_every_lane() did not recognise that message. The folded form with ordered LDS (which the test refused_programs_fold_with_ordered_lds promises) was never tried at runtime. Add the message to needs_every_lane() in emit/lower/analysis.rs so the ladder opens and the exact forms can be taken. Fixes #66
Programs in WIDE_SKIP_DEFAULT (like CS_TemporalResolve1_Alpha, hash
34992f2b65a789a5) were refused with 'no wave32 lowering for this wave64
program', but the retry ladder in emit_strict never opened for them because
needs_every_lane() did not recognise that message. The folded form with
ordered LDS (which the test refused_programs_fold_with_ordered_lds promises)
was never tried at runtime.

Add the message to needs_every_lane() in emit/lower/analysis.rs so the
ladder opens and the exact forms can be taken.

This changes the translated form of 34992f2b (temporal resolve) on every
32-lane card. An in-game before/after of the same spot is needed to verify
the denoiser pass now runs correctly, especially on glass and alpha surfaces.

Fixes #66
Author
First-time contributor

Note: This replaces PR #122 (which replaced #108) due to recurring 'missing fork information' errors. Previous testing: tyr0nsur tested the fix on an RTX 4060 and found that the NO_WAVE32_LOWERING message is created by supported() after the retry ladder. See their detailed analysis on issue #66. f41 tested this PR together with #92 in combined builds on an RTX 5090 and found no issues. See their comment on PR #92.

Note: This replaces PR #122 (which replaced #108) due to recurring 'missing fork information' errors. Previous testing: tyr0nsur tested the fix on an RTX 4060 and found that the NO_WAVE32_LOWERING message is created by supported() after the retry ladder. See their detailed analysis on issue #66. f41 tested this PR together with #92 in combined builds on an RTX 5090 and found no issues. See their comment on PR #92.
Owner

This is the same one-line change as #98, #106, #108 and #122.

tyr0nsur checked it on an RTX 4060 in #108 (comment 851084). The successful first lowering returns Ok((_, Some(64))), so it already enters the retry ladder. The "no wave32 lowering" refusal is only created after the ladder has run, so the new comparison in needs_every_lane never sees it. With this change the DXIL and results were identical to main.

For a merge it needs a log from the game where this exact program is refused on main and runs with the change, as asked in #98. Please add that evidence to this PR rather than opening it again.

This is the same one-line change as #98, #106, #108 and #122. tyr0nsur checked it on an RTX 4060 in #108 ([comment 851084](https://git.gtahub.st/TrustNo1/Darner/pulls/108#issuecomment-851084)). The successful first lowering returns `Ok((_, Some(64)))`, so it already enters the retry ladder. The "no wave32 lowering" refusal is only created after the ladder has run, so the new comparison in `needs_every_lane` never sees it. With this change the DXIL and results were identical to `main`. For a merge it needs a log from the game where this exact program is refused on `main` and runs with the change, as asked in #98. Please add that evidence to this PR rather than opening it again.
First-time contributor

Tested PR #123 at 47beb2f on Windows (RTX 5080). Build OK (5m 35s). cargo test -p darner-shader --lib: 554 passed, 2 failed, 15 ignored; both failures reproduce with analysis.rs reverted to its pre-PR form, so they are pre-existing.

darner translate over a GTA6 dump: identical summaries before/after (26,180/26,180 programs, 2,762/2,763 compute emitted), including with DARNER_HOST_WAVE=32 and DARNER_EXACT64=34992f2b65a789a5.

In game at Jason's house, the log shows the refusal still happens with the change applied:

  • main: shader does not translate ... hash=34992f2b65a789a5 error=... no wave32 lowering for this wave64 program is not supported, then a first bind of the same hash
  • #123: a first bind of the same hash, then the same no wave32 lowering refusal; the end-of-run summary reads 1 shaders do not translate ... retried=0 retry_made=0

A targeted warm of just 34992f2b65a789a5 gives the same result on both builds: 1 do not translate.

So this does not fix the refusal in game, matching the maintainer's analysis that the refusal is created after the retry ladder. Glass at the house looked normal on the #123 build (visual check only). Not tested: DXIL validation.

Drafted with AI assistance (OpenCode).

Tested PR #123 at 47beb2f on Windows (RTX 5080). Build OK (5m 35s). `cargo test -p darner-shader --lib`: 554 passed, 2 failed, 15 ignored; both failures reproduce with analysis.rs reverted to its pre-PR form, so they are pre-existing. `darner translate` over a GTA6 dump: identical summaries before/after (26,180/26,180 programs, 2,762/2,763 compute emitted), including with `DARNER_HOST_WAVE=32` and `DARNER_EXACT64=34992f2b65a789a5`. In game at Jason's house, the log shows the refusal still happens with the change applied: - main: shader does not translate ... hash=34992f2b65a789a5 error=... no wave32 lowering for this wave64 program is not supported, then a first bind of the same hash - #123: a first bind of the same hash, then the same no wave32 lowering refusal; the end-of-run summary reads 1 shaders do not translate ... retried=0 retry_made=0 A targeted warm of just 34992f2b65a789a5 gives the same result on both builds: 1 do not translate. So this does not fix the refusal in game, matching the maintainer's analysis that the refusal is created after the retry ladder. Glass at the house looked normal on the #123 build (visual check only). Not tested: DXIL validation. Drafted with AI assistance (OpenCode).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/issue-66-wave32-retry-ladder:CRCODE22-fix/issue-66-wave32-retry-ladder'
git switch 'CRCODE22-fix/issue-66-wave32-retry-ladder'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'CRCODE22-fix/issue-66-wave32-retry-ladder'
git switch 'CRCODE22-fix/issue-66-wave32-retry-ladder'
git rebase 'main'
git switch 'main'
git merge --ff-only 'CRCODE22-fix/issue-66-wave32-retry-ladder'
git switch 'CRCODE22-fix/issue-66-wave32-retry-ladder'
git rebase 'main'
git switch 'main'
git merge --no-ff 'CRCODE22-fix/issue-66-wave32-retry-ladder'
git switch 'main'
git merge --squash 'CRCODE22-fix/issue-66-wave32-retry-ladder'
git switch 'main'
git merge --ff-only 'CRCODE22-fix/issue-66-wave32-retry-ladder'
git switch 'main'
git merge 'CRCODE22-fix/issue-66-wave32-retry-ladder'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!123
No description provided.