WIP: [pr-feature][INTEL] Add XeSS Super Resolution where DLSS does not upscale #47

Draft
kisekinopureya wants to merge 24 commits from kisekinopureya:kisekinopureya/pr/xess-sr into main
Contributor

Contributor role (optional)

  • Fluxer ID: 1576376229534109696

What it changes

XeSS upscaling. DARNER_XESS=1 has Intel XeSS-SR take the title's FidelityFX upscale dispatches
that DLSS does not, at the same place in the title's list and from the same inputs. libxess.dll is
loaded at run time from DARNER_XESS_DIR after its signature is checked; nothing of Intel's is in the
repository.

  • Init flags, quality, jitter, velocity scale, exposure and reset come from the dispatch each frame.
  • Refusals go to the title's own upscaling or the bilinear fallback; a failed execution runs the
    fallback in its place.

DARNER_XESS_MODE: XeSS's quality names at XeSS's ratios (ultraquality 1.5x, quality 1.7x,
balanced 2.0x, performance 2.3x, ultraperformance 3x, nativeaa).

F1 menu. On an Intel card, XeSS and its preset take DLSS's
place; the NVIDIA-only rows are hidden. Their text is in locales/en.json
(menu.setting.xess*, menu.value.xess.*), as the rest of the menu's is; there is no Chinese text
for them yet, so they show in English there.

F3 panel. Shows XeSS's scene and output sizes and its preset.

The menu tests no longer depend on the test machine's card.

Known issue: the quality preset (1.7x) reuses FidelityFX's "balanced" slot, so the F3 panel and the
log name it BALANCED while it renders at quality's size (1129x635 for 1920x1080). The label should
follow the mode.

How it was tested

  • Tested revision: 3a5813d2e2 (rebased onto 1a5286a7; the gates re-run there)
  • Commands and results: both clippy gates clean; the shader cache key, menu (38 tests) and panel tests
    pass; xess and streamline tests pass.
  • Gameplay: base branch, Arc A770, Series S, 1920x1080, DARNER_XESS=1 DARNER_XESS_MODE=quality,
    libxess.dll 2.0.2.
    • Every upscale went to XeSS (about 3,000), none failed.
    • A steady 10-12 fps in the prison cell (user), better than without XeSS.
    • The run ended after about 9 minutes in a device removal (0x887A0006, page fault). XeSS was
      working up to it. A later traced run with XeSS (the traced run in the shared record) stopped in a
      mesh-shader draw with XeSS's work done, so XeSS is not what failed there.
  • Coverage gaps: NVIDIA and AMD with XeSS; the other presets except ultraperformance (run 3).

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 #44 (switch::intel, used by the menu), then #43, #33, #31

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #3 (also changes crates/darner-gpu/src/host/menu.rs, crates/darner-gpu/src/host/panel.rs); #6 (also changes crates/darner-gpu/src/lib.rs); #8 (also changes crates/darner-gpu/src/host/menu.rs, crates/darner-gpu/src/lib.rs, crates/darner-gpu/src/streamline.rs); #9 (also changes apps/darner/src/run.rs, crates/darner-gpu/src/host/menu.rs, crates/darner-gpu/src/lib.rs, crates/darner-hle/src/lib.rs); #11 (also changes apps/darner/src/run.rs); #12 (also changes apps/darner/src/run.rs, crates/darner-gpu/src/host/menu.rs, crates/darner-gpu/src/lib.rs, crates/darner-hle/src/lib.rs); #16 (also changes apps/darner/src/run.rs, crates/darner-gpu/src/host/menu.rs, crates/darner-gpu/src/lib.rs, crates/darner-hle/src/lib.rs); #24 (also changes apps/darner/src/run.rs); #25 (also changes apps/darner/src/main.rs, crates/darner-gpu/src/host/menu.rs, crates/darner-gpu/src/lib.rs, crates/darner-hle/src/lib.rs); #26 (also changes apps/darner/src/main.rs, crates/darner-gpu/src/host/menu.rs, crates/darner-gpu/src/host/panel.rs).

🤖 Generated with Claude Code

## Contributor role (optional) - Fluxer ID: 1576376229534109696 ## What it changes **XeSS upscaling.** `DARNER_XESS=1` has Intel XeSS-SR take the title's FidelityFX upscale dispatches that DLSS does not, at the same place in the title's list and from the same inputs. `libxess.dll` is loaded at run time from `DARNER_XESS_DIR` after its signature is checked; nothing of Intel's is in the repository. - Init flags, quality, jitter, velocity scale, exposure and reset come from the dispatch each frame. - Refusals go to the title's own upscaling or the bilinear fallback; a failed execution runs the fallback in its place. **`DARNER_XESS_MODE`:** XeSS's quality names at XeSS's ratios (ultraquality 1.5x, quality 1.7x, balanced 2.0x, performance 2.3x, ultraperformance 3x, nativeaa). **F1 menu.** On an Intel card, XeSS and its preset take DLSS's place; the NVIDIA-only rows are hidden. Their text is in `locales/en.json` (`menu.setting.xess*`, `menu.value.xess.*`), as the rest of the menu's is; there is no Chinese text for them yet, so they show in English there. **F3 panel.** Shows XeSS's scene and output sizes and its preset. The menu tests no longer depend on the test machine's card. Known issue: the quality preset (1.7x) reuses FidelityFX's "balanced" slot, so the F3 panel and the log name it BALANCED while it renders at quality's size (1129x635 for 1920x1080). The label should follow the mode. ## How it was tested - Tested revision: 3a5813d2e2 (rebased onto `1a5286a7`; the gates re-run there) - Commands and results: both clippy gates clean; the shader cache key, menu (38 tests) and panel tests pass; `xess` and `streamline` tests pass. - Gameplay: base branch, Arc A770, Series S, 1920x1080, `DARNER_XESS=1 DARNER_XESS_MODE=quality`, `libxess.dll` 2.0.2. - Every upscale went to XeSS (about 3,000), none failed. - A steady 10-12 fps in the prison cell (user), better than without XeSS. - The run ended after about 9 minutes in a device removal (0x887A0006, page fault). XeSS was working up to it. A later traced run with XeSS (the traced run in the shared record) stopped in a mesh-shader draw with XeSS's work done, so XeSS is not what failed there. - Coverage gaps: NVIDIA and AMD with XeSS; the other presets except ultraperformance (run 3). ## 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 #44 (`switch::intel`, used by the menu), then #43, #33, #31 ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #3 (also changes `crates/darner-gpu/src/host/menu.rs`, `crates/darner-gpu/src/host/panel.rs`); #6 (also changes `crates/darner-gpu/src/lib.rs`); #8 (also changes `crates/darner-gpu/src/host/menu.rs`, `crates/darner-gpu/src/lib.rs`, `crates/darner-gpu/src/streamline.rs`); #9 (also changes `apps/darner/src/run.rs`, `crates/darner-gpu/src/host/menu.rs`, `crates/darner-gpu/src/lib.rs`, `crates/darner-hle/src/lib.rs`); #11 (also changes `apps/darner/src/run.rs`); #12 (also changes `apps/darner/src/run.rs`, `crates/darner-gpu/src/host/menu.rs`, `crates/darner-gpu/src/lib.rs`, `crates/darner-hle/src/lib.rs`); #16 (also changes `apps/darner/src/run.rs`, `crates/darner-gpu/src/host/menu.rs`, `crates/darner-gpu/src/lib.rs`, `crates/darner-hle/src/lib.rs`); #24 (also changes `apps/darner/src/run.rs`); #25 (also changes `apps/darner/src/main.rs`, `crates/darner-gpu/src/host/menu.rs`, `crates/darner-gpu/src/lib.rs`, `crates/darner-hle/src/lib.rs`); #26 (also changes `apps/darner/src/main.rs`, `crates/darner-gpu/src/host/menu.rs`, `crates/darner-gpu/src/host/panel.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]>
DARNER_XESS=1 has Intel XeSS-SR take the title's FidelityFX upscale
dispatches that DLSS does not, at the same place in the title's list and
from the same inputs. libxess.dll is loaded at run time from
DARNER_XESS_DIR after its signature is checked. Init flags, quality
setting, jitter, velocity scale, exposure and reset come from the
dispatch each frame. Refusals go to the title's own upscaling or the
bilinear fallback; a failed execution runs the fallback in its place.

`darner upscaler-check --xess` runs DLSS's deterministic fixture through
every quality setting XeSS offers. Not yet run on a GPU or with the title.

Darner: XeSS's scene, output and preset go into the F3 panel's Numbers (Darner's panel layout).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit f66e03611d6024e2b77bb378b5f8ad95ebb78f2c)
The scene scale for XeSS was set by DARNER_DLSS_MODE, by DLSS's names
and ratios, so XeSS's own presets were reached only by their nearest
DLSS scale and its performance (2.3x) not at all. DARNER_XESS_MODE
takes nativeaa, ultraquality (1.5x), quality (1.7x), balanced (2.0x),
performance (2.3x) and ultraperformance (3.0x): four are scales Mode
already had, and two are new variants (XessQuality, XessPerformance),
each noted to the title as the FidelityFX mode of the next larger scene.
Ultra quality plus (1.3x) is refused: its scene is above the title's own
2/3, which it has no room for. Both variables set is an error. The DLSS
probes take Mode::sl_mode instead of repeating its match.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit ad73d4382dcf0e38a9586940f7871465ee3531d8)
The menu of an Intel card leaves out
DLSS and its model, frame generation (it runs only with DLSS's upscaling),
MFG Unlocker and the Series S picture (the DLSS mode's scene there), and
shows XESS and XESS PRESET (DARNER_XESS_MODE's six presets); other menus
are as before. switch::intel tells the menu the card's vendor.

Darner: XESS and XESS PRESET are on the PICTURE page; the Intel menu also leaves out PICTURE SIZE (a larger Series S output needs DLSS); the page tests know XeSS's rows are the Intel menu's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e1f647955c2cdaf1b0e709b0c540dbadd9be6326)
A test that makes a device on an Intel card set the host's vendor for the
whole test run, and the menu tests after it saw the Intel menu (four of
them failed in a full run on an Arc A770, passed alone).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit cc36e5eeb93a6da3b39aa941fecb64d07f2fe83d)
This pull request has changes conflicting with the target branch.
  • apps/darner/src/main.rs
  • apps/darner/src/run.rs
  • crates/darner-gpu/src/host/menu.rs
  • crates/darner-gpu/src/host/panel.rs
  • crates/darner-hle/src/lib.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

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