WIP: [pr-fix][lighting][shaders][INTEL] Light clustering: exact on 32-lane hosts, approximate on Intel, one exchange per half #33

Draft
kisekinopureya wants to merge 6 commits from kisekinopureya:kisekinopureya/pr/light-clustering into main
Contributor

Contributor role (optional)

  • Fluxer ID: 1576376229534109696

What it changes

  • Exact on 32-lane hosts: tiled_lighting:CS_ClusterLightsWorldSpace (groups of 64) joins the
    wave-wide-by-default list. Before, it fell back to an approximate local-waves form, each host wave
    building its own half of a console wave's light lists.
  • One exchange per half: a first-lane read in the wave-wide form exchanges the halves' "has a lane"
    flag and value in one meeting (two group barriers instead of four). On an A770 the clustering
    dispatch went from 228 to about 125 ms a frame.
  • Approximate on an Intel card: the clustering keeps the approximate form there, 281 ms against
    523 ms on the card in a replay of the prison cell, 46.3 dB against the exact picture.
    DARNER_CLUSTER_LIGHTS_EXACT=1 brings the exact form back (in the shader cache key).
  • Tests: an ignored forms-of-dumped-containers diagnostic test (DARNER_FORMS_DIR,
    DARNER_FORMS_OUT), listed as test switches in the key test.

How it was tested

  • Tested revision: eb6de67955 (rebased onto 1a5286a7; the gates re-run there)
  • Commands and results: both clippy gates clean; the shader cache key, menu and panel tests pass;
    wave64_tests pass.
  • Gameplay: base branch on the A770, where the paired-lanes PR then takes this program; not judged
    separately.
  • Coverage gaps: the replay numbers are from VIctory-NVIDIA, not repeated with Darner.

Checklist

  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on #31 (host_intel)

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #10 (also changes crates/darner-shader/src/emit/lower.rs).

🤖 Generated with Claude Code

## Contributor role (optional) - Fluxer ID: 1576376229534109696 ## What it changes - **Exact on 32-lane hosts:** `tiled_lighting:CS_ClusterLightsWorldSpace` (groups of 64) joins the wave-wide-by-default list. Before, it fell back to an approximate local-waves form, each host wave building its own half of a console wave's light lists. - **One exchange per half:** a first-lane read in the wave-wide form exchanges the halves' "has a lane" flag and value in one meeting (two group barriers instead of four). On an A770 the clustering dispatch went from 228 to about 125 ms a frame. - **Approximate on an Intel card:** the clustering keeps the approximate form there, 281 ms against 523 ms on the card in a replay of the prison cell, 46.3 dB against the exact picture. `DARNER_CLUSTER_LIGHTS_EXACT=1` brings the exact form back (in the shader cache key). - **Tests:** an ignored forms-of-dumped-containers diagnostic test (`DARNER_FORMS_DIR`, `DARNER_FORMS_OUT`), listed as test switches in the key test. ## How it was tested - Tested revision: eb6de67955 (rebased onto `1a5286a7`; the gates re-run there) - Commands and results: both clippy gates clean; the shader cache key, menu and panel tests pass; `wave64_tests` pass. - Gameplay: base branch on the A770, where the paired-lanes PR then takes this program; not judged separately. - Coverage gaps: the replay numbers are from VIctory-NVIDIA, not repeated with Darner. ## Checklist - [ ] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on #31 (host_intel) ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #10 (also changes `crates/darner-shader/src/emit/lower.rs`). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The vendor is part of the host settings and the translation fingerprint
(lower::host_intel, set when the device is made), for the Intel-only forms
that follow.

In VIctory-NVIDIA this came with leaving the particle light atlas
unfolded on Intel cards (the folded CS_lightAtlas programs hung an Arc
A770's device in the prison cell in three runs of three). Darner already
leaves it unfolded on every card (UNFOLDED_BY_DEFAULT), so only the vendor
detection is ported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 18e8c457d1c80244e9da74b094dc70311e397428)
tiled_lighting:CS_ClusterLightsWorldSpace (groups of 64) fell back to an
approximate local-waves form, each host wave building its own half of a
console wave's light lists: the blocky checkerboard on lit surfaces seen
on an Arc A770. It joins the wave-wide-by-default list. Adds the ignored
forms_of_dumped_containers diagnostic test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e5b1788c470b8fd9c70e3b5092d8f814d7de332d)
A first-lane read in the wave-wide form exchanged the two halves' "has a
lane" flags and then their values, four group barriers. Both words now go
through one exchange of four LDS words a console wave (two barriers),
falling back to the two exchanges where private LDS is short. On the
Arc A770 the light clustering's dispatch went from 228 to about 125 ms a
frame (127 to 75 barrier sites). The forms test can also save each
translation (DARNER_FORMS_OUT).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit b173c163cfae6716acbc1a4c30621d4a0d6f4bff)
tiled_lighting:CS_ClusterLightsWorldSpace was made exact (wave-wide
branches) for the Arc's checkerboard, which turned out to be the
shadow masks' LDS race. On an A770 its exact form costs most of the
frame: in a replay of the prison cell 244 of 523 ms on the card. In its
approximate form the frame took 281 ms, with a picture as close to the
exact one (46.3 dB) as two runs of the exact form are to each other.
On an Intel card it now keeps that form; DARNER_CLUSTER_LIGHTS_EXACT=1
restores the exact one (in the shader cache key). Other cards are
unchanged.

In a five-minute XeSS quality run the cell went from about 2.2 to
4.5-5.8 fps. That run lost the device once after 110 s; a repeat with
full DRED did not.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 128101fe53959fbf2ce97004ed31d33eae9b46ea)
Docs that stay in VIctory-NVIDIA (the Arc tracker, the XeSS notes) are
named as its; the product is Darner.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 594c87446d023c4268dcfd482d1bdd989ac4fe48)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 1045f0ce51fab3a70dc8e1d1f0f6d39a82e3e419)
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'kisekinopureya/pr/light-clustering:kisekinopureya-kisekinopureya/pr/light-clustering'
git switch 'kisekinopureya-kisekinopureya/pr/light-clustering'

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 'kisekinopureya-kisekinopureya/pr/light-clustering'
git switch 'kisekinopureya-kisekinopureya/pr/light-clustering'
git rebase 'main'
git switch 'main'
git merge --ff-only 'kisekinopureya-kisekinopureya/pr/light-clustering'
git switch 'kisekinopureya-kisekinopureya/pr/light-clustering'
git rebase 'main'
git switch 'main'
git merge --no-ff 'kisekinopureya-kisekinopureya/pr/light-clustering'
git switch 'main'
git merge --squash 'kisekinopureya-kisekinopureya/pr/light-clustering'
git switch 'main'
git merge --ff-only 'kisekinopureya-kisekinopureya/pr/light-clustering'
git switch 'main'
git merge 'kisekinopureya-kisekinopureya/pr/light-clustering'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
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!33
No description provided.