WIP: [pr-performance][INTEL] Intel defaults for the Arc frame: lazy compares, joined copies, late wait 2, paired material masks #44

Draft
kisekinopureya wants to merge 20 commits from kisekinopureya/Darner:kisekinopureya/pr/intel-defaults into main
Contributor

Contributor role (optional)

  • Fluxer ID: 1576376229534109696

What it changes

On an Intel card, unless their variables are set (switch.rs, INTEL_DEFAULTS, logged at start):

  • DARNER_LAZY_COMPARE_MB=64 and DARNER_CARD_STEPS_JOIN=4096, the CPU-side work the A770's frame was
    bound by (4.3 to 5.6 fps in the cell runs, 2026-12-01).
  • DARNER_LATE_WAIT=2: at stage 3 the A770 drew skinned characters with vertices thrown across the
    screen. Stage 2 costs about 8%.
  • deferred_tiled:CS_DepthProcessingHBO takes the paired form first (DARNER_HBO_PAIRED=0: not), and
    tiled_lighting:CS_GenerateMaterialMasks does too (DARNER_INTEL_PAIRS=0: none). The latter made
    the frame 11.9 ms shorter in replays.

In unit tests the defaults are left out: a test that made a device on an Intel card used to change the
switches of every test after it.

Known interaction: XeSS frame generation (#48) needs DARNER_LATE_WAIT=3, so with this default
it stays off.

How it was tested

  • Tested revision: 4522656756 (rebased onto 1a5286a7; the gates re-run there)
  • Commands and results: both clippy gates clean; the shader cache key, menu and panel tests pass.
  • Gameplay: base branch on an Arc A770; the log listed the three defaults. No stray triangles in the
    prison at late wait 2 (user).
  • Coverage gaps: the fps numbers are from VIctory-NVIDIA.

Checklist

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

Checked for overlap

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

🤖 Generated with Claude Code

## Contributor role (optional) - Fluxer ID: 1576376229534109696 ## What it changes On an Intel card, unless their variables are set (`switch.rs`, `INTEL_DEFAULTS`, logged at start): - `DARNER_LAZY_COMPARE_MB=64` and `DARNER_CARD_STEPS_JOIN=4096`, the CPU-side work the A770's frame was bound by (4.3 to 5.6 fps in the cell runs, 2026-12-01). - `DARNER_LATE_WAIT=2`: at stage 3 the A770 drew skinned characters with vertices thrown across the screen. Stage 2 costs about 8%. - `deferred_tiled:CS_DepthProcessingHBO` takes the paired form first (`DARNER_HBO_PAIRED=0`: not), and `tiled_lighting:CS_GenerateMaterialMasks` does too (`DARNER_INTEL_PAIRS=0`: none). The latter made the frame 11.9 ms shorter in replays. In unit tests the defaults are left out: a test that made a device on an Intel card used to change the switches of every test after it. Known interaction: XeSS frame generation (#48) needs `DARNER_LATE_WAIT=3`, so with this default it stays off. ## How it was tested - Tested revision: 4522656756 (rebased onto `1a5286a7`; the gates re-run there) - Commands and results: both clippy gates clean; the shader cache key, menu and panel tests pass. - Gameplay: base branch on an Arc A770; the log listed the three defaults. No stray triangles in the prison at late wait 2 (user). - Coverage gaps: the fps numbers are from VIctory-NVIDIA. ## 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 #43 (paired form), #33, #31 ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #25 (also changes `crates/darner-gpu/src/host.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)
From the Whiplash-NVIDIA tree: one host wave of 32 lanes runs one console
wave of 64, each thread running console lanes n and n + 32. Every per-lane
branch is taken wave-wide (structure_wide); LDS inside the wave is ordered
by fences, not group barriers; the only barrier added is on entry, where a
group of several console waves numbers them. It is tried after the folded
form and before the approximate and wave-wide forms, and only when asked
for: DARNER_WAVE_PAIRS=1 (every wave64 compute program) or
DARNER_PAIRED_ONLY=<digest prefix or program text>, both in the shader
cache key.

Differences from Whiplash-NVIDIA: a dispatch counted in threads, and wave
sums of 16-bit floats and of doubles, are refused in this form.

emit/paired_tests.rs (four tests: LDS and lane reads across the halves
without barriers, waves looping apart, permutes and lane writes, a wave OR
in a lane branch) pass on an Arc A770. docs/arc-perf-comparison.md compares
this tree's Arc frame time with the Whiplash AMD and NVIDIA trees.

Darner: tried right after the fold closure is defined (Darner folds later in its ladder), and refused for programs with lifted ray queries, whose per-block state is one lane's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 7c7c0948eb38d2d451a0ce5a65266ca1bf3629d6)
What the merge of arc-perf-compare into intel-arc decided: on an Intel
card tiled_lighting:CS_ClusterLightsWorldSpace takes the paired form
(falling to the approximate one if the lowering refuses it), and
DARNER_CLUSTER_LIGHTS=approximate or exact picks another (replacing
DARNER_CLUSTER_LIGHTS_EXACT, in the shader cache key). Other cards keep
the wave-wide form. Replay of the prison cell on an A770: wave-wide
523 ms a frame on the card, approximate 281 ms, paired 289 ms; against
the wave-wide picture paired 50.0 dB, approximate 46.3 dB, two
wave-wide runs 46.2 dB. DARNER_WAVE_PAIRS=0 turns the paired default
off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 90a9963c85b4d2278af6977332aa27acc3cfff9a)
A program named there now takes the paired form before the plain
lowering, which may translate a console wave64 program as two host
waves exchanging cross-lane values through group barriers. Refused, the
program goes on as before. Defaults are unchanged.

For CS_GenerateMaterialMasks on an Arc A770 this removed its five group
barriers: its list replayed alone fell from 38.6 to 27.0 ms and the
picture is 61.2 dB from the default. The whole frame did not change
(about 182 ms either way): the card had filled those waits with the
next lists' work, so the frame is bound by total work. Recorded in
docs/arc-a770.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 1da6dbb8742d6588a8e2a671d93bcb5fd148d833)
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 096379aa62bf4bd4fdd2263f2122c4902b2ae3a5)
On an Intel card, unless their variables are set:

- deferred_tiled:CS_DepthProcessingHBO takes the paired form first
  (DARNER_HBO_PAIRED=0: not; in the shader cache key). Its plain
  lowering trades values through 26 group barriers; paired it
  validates with 13, reached by the group's one host wave.
- DARNER_LAZY_COMPARE_MB=64 and DARNER_LAZY_NARROW=1,
  DARNER_CARD_STEPS_JOIN=4096, DARNER_TABLE_SAME=1,
  DARNER_ROOT_SAME=1, DARNER_THIN_COALESCE=1, from a table in
  switch.rs that the host fills in when it finds the card (logged).

None was run on the card before being made a default: the first run
should check skinned characters and the ambient occlusion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 8b260025a3287f475162d06a106b65763a7199d8)
The cell runs put the +30% (4.3 to 5.6 fps) in DARNER_LAZY_COMPARE_MB
and DARNER_CARD_STEPS_JOIN. DARNER_LAZY_NARROW, DARNER_TABLE_SAME,
DARNER_ROOT_SAME and DARNER_THIN_COALESCE each moved fps by less than
run-to-run noise and are no longer defaults (still `1` to set). HBO
paired stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 253c9ffd0411b06fffe62a2d66fed545e531685e)
At stage 3 (the default with the relay on) the present no longer
settles the flights in the air, and on the Arc A770 skinned characters
were drawn with vertices thrown across the screen (the café cutscene,
the prison-cell doorway) in every watched run but one; at stages 1 and
2, and with the relay off, in none. Stage 2 cost about 8% (median 4.8
fps against 5.2), stage 1 about 15%, the relay off 44%.

late_stage reads DARNER_LATE_WAIT through crate::switch, so an Intel
card takes 2 unless it is set. Untried in a run with this build: the
log line "switches an Intel card gets unless set" should name it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 3eb678e441dfedd1b15c09504fc4592924cc8f1f)
tiled_lighting:CS_GenerateMaterialMasks is one console wave of 64 lanes
to a group; its plain lowering is two host waves trading values through
five group barriers. A replay of the prison cell on the Arc A770, ten
loops with the two forms in turn from one load, took 180.1 ms on the
card paired against 205.6 plain (-25 ms, 12%), the loops' pictures the
same. Left out entirely the program saved 21.7 ms, more than any other
in the frame. DARNER_MASKS_PAIRED=0 (in the shader cache's key): not.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit bf2873628ae3d6bbe7d18fe141db0042f2546e7a)
terrain CS_ComputeFeedbackList, the two particle lightAtlas programs,
CS_WriteRasterClassificationResults and CS_ProjDecalResolve_Scalarized
were the frame's other console wave64 programs lowered as two host
waves trading values through barriers. Paired together, a replay of the
prison cell on the Arc A770 took 200.6 ms on the card against 209.9
(ten loops, in turn, one load), the loops' pictures the same as the
plain forms'. With the material masks they make one list by digest,
INTEL_PAIRED; DARNER_INTEL_PAIRS=0 (replacing DARNER_MASKS_PAIRED)
turns all six off. Not DARNER_WAVE_PAIRS=1 for everything: Whiplash
found one program drawing dark slabs paired.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 76b0873e92513227c8d3778c1cdc3e9f12500569)
Measured again with --compare --replicas 4 (eight loops, each form
prepared four times, run in turn): the material masks paired save 11.9
ms of the cell frame (the earlier 25.4 was a single-instance figure),
the HBO pass 16.6 ms, but the five other wave64 programs together 1.1
ms, within the noise. Those five are left out of INTEL_PAIRED again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 2b7300b49ff778c70be357da2deb192e9b132bd4)
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 886f2faa16d11ac0d25b4d8d4217592f3c61e1aa)
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 b317a85538a5d807b389dea6cefeb91b169ed3b7)
A test that makes a device on an Intel card sets the host's vendor for
the whole test run, and every test after it would read the Intel
defaults (DARNER_LATE_WAIT, DARNER_CARD_STEPS_JOIN,
DARNER_LAZY_COMPARE_MB) where the others read them unset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 265da19cec8efe86b9404e0a30b2a30644e44655)
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]>
kisekinopureya force-pushed kisekinopureya/pr/intel-defaults from 621e5f3281 to 4522656756 2026-12-03 21:13:32 +00:00 Compare
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

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

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/intel-defaults'
git switch 'kisekinopureya-kisekinopureya/pr/intel-defaults'
git rebase 'main'
git switch 'main'
git merge --ff-only 'kisekinopureya-kisekinopureya/pr/intel-defaults'
git switch 'kisekinopureya-kisekinopureya/pr/intel-defaults'
git rebase 'main'
git switch 'main'
git merge --no-ff 'kisekinopureya-kisekinopureya/pr/intel-defaults'
git switch 'main'
git merge --squash 'kisekinopureya-kisekinopureya/pr/intel-defaults'
git switch 'main'
git merge --ff-only 'kisekinopureya-kisekinopureya/pr/intel-defaults'
git switch 'main'
git merge 'kisekinopureya-kisekinopureya/pr/intel-defaults'
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!44
No description provided.