WIP: [pr-diagnostics][startup][INTEL] Graphics pipelines made in the run on request; replay pipelines from cached blobs #46

Draft
kisekinopureya wants to merge 16 commits from kisekinopureya/Darner:kisekinopureya/pr/graphics-library into main
Contributor

Contributor role (optional)

  • Fluxer ID: 1576376229534109696

What it changes

  • DARNER_LIBRARY_GRAPHICS=0 makes graphics pipelines (vertex, mesh) in each run and keeps them out
    of the library; compute ones are still loaded. It is off by default. On an A770 a graphics pipeline
    loaded from the library drew about a third slower than one made (replay: 890-900 ms against
    726-732 ms). In play it cost 10-30 s of slow frames at the start, with the same card time.
  • Replay: DARNER_REPLAY_BLOBS=<folder> keeps each pipeline's cached blob and makes the pipeline from
    that.

How it was tested

  • Tested revision: 9c72486ed1 (rebased onto 1a5286a7; the gates re-run there)
  • Commands and results: both clippy gates clean; the shader cache, menu and panel tests pass.
  • Gameplay: off by default; the base-branch runs used the library as before.
  • Coverage gaps: DARNER_LIBRARY_GRAPHICS=0 not run 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 #45 (replay), which depends on #31

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: CodeFloe #328 and 3532f905 (both in main since 2026-12-03) also change crates/darner-gpu/src/pipeline/library.rs; this rebased onto them without conflict.

🤖 Generated with Claude Code

## Contributor role (optional) - Fluxer ID: 1576376229534109696 ## What it changes - `DARNER_LIBRARY_GRAPHICS=0` makes graphics pipelines (vertex, mesh) in each run and keeps them out of the library; compute ones are still loaded. It is off by default. On an A770 a graphics pipeline loaded from the library drew about a third slower than one made (replay: 890-900 ms against 726-732 ms). In play it cost 10-30 s of slow frames at the start, with the same card time. - Replay: `DARNER_REPLAY_BLOBS=<folder>` keeps each pipeline's cached blob and makes the pipeline from that. ## How it was tested - Tested revision: 9c72486ed1 (rebased onto `1a5286a7`; the gates re-run there) - Commands and results: both clippy gates clean; the shader cache, menu and panel tests pass. - Gameplay: off by default; the base-branch runs used the library as before. - Coverage gaps: `DARNER_LIBRARY_GRAPHICS=0` not run 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 #45 (replay), which depends on #31 ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: CodeFloe #328 and `3532f905` (both in `main` since 2026-12-03) also change `crates/darner-gpu/src/pipeline/library.rs`; this rebased onto them without conflict. 🤖 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)
The Arc A770 reports resource heap tier 1: each heap is now made for the
one kind of resource the capture puts in it (2,597 heaps, none mixed),
and resources made for sharing across adapters drop that flag, since
replay runs on one adapter. A capture recorded on the A770 now loads and
runs there (612 ms on the card).

With --breadcrumbs a failure while running the frame (not only while
loading it) prints the debug layer's errors and DRED breadcrumbs. Replay
lists are named "replay submit <i> list <j>", and the report shows each
partly done list with the ops around the stop and counts the lists that
never started.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 5e406e540cb56f3d97d2c9d55e434dc62fb7b38b)
`darner replay --retranslate` now translates each program under its
name (emit::with_program), so the settings that name programs apply as
in a run: the face network's exemption from the LDS bounds, the
reflections' wave-wide skips. Unnamed, the face programs were held to
their headers' LDS sizes, which in a run leaves faces undrawn; in a
replay of the prison cell on an Arc A770 that hid 12 ms of
CS_SmallMatMulOperation's true cost (29.4 ms, not 17.1).

DARNER_WAVE_SIZE_FREE=<hash>,... (diagnostic, in the shader cache key)
leaves the named programs without a declared wave size, to time what a
forced width costs. For CS_GenerateMaterialMasks the replayed frame
lost the device: its lane-dependent code needs the 32-lane width as
translated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 2f631201275a754ad6da7b6ef0e923dcf242e1a5)
The replay report now lists the 15 costliest lists of the last loop,
numbered as --listing numbers them, from the stamps per-list timing
already takes.

On the A770, --timing detailed (a timestamp after every command)
serializes the frame: the prison frame read 288 ms that way and 182 ms
timed per list. docs/arc-a770.md records the correction and where the
182 ms goes: CS_GenerateMaterialMasks 20.8 ms and CS_DepthProcessingHBO
17.8 ms, measured with their lists replayed alone, where the two timings
agree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 5e3e09f9028aa92ae8f7eb4896d9cb8a47cca6b6)
The wedges are geometry in the G-buffer (jumpsuit-orange albedo, motion
vectors up to 457 px) drawn by pipeline 3286, mesh 093c64546c55554e;
the earlier lead, pixel program 573d1857e903fab5, draws the bars
beneath. Its form without the Intel legacy products leaves them as
they are, and its wave reads are uniform: the next suspect is the data
its vertex and matrix reads find.

`replay --retranslate` takes DARNER_HOST_INTEL=1 for the Intel forms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 07396f77db710a1406239a893ec16ef6bfd92300)
Every replay compiled all of the capture's pipelines again: on an Arc
A770 the cell frame's 1,077 took 184 s of a 192 s load. They now go
into a pipeline library beside the capture (pipelines.lib), named by a
hash of their whole description with the shaders' bytes as used, and
are loaded from it the next time. A library of another adapter or
driver is refused and made anew; DARNER_REPLAY_LIBRARY=0 keeps none.

--skip-each <text> (repeatable) runs the frame as recorded and once
without each program, turn by turn in each loop from one load, and
prints what each costs the whole frame: a leave-one-out study of ten
programs was ten loads (about an hour), now one.

Darner: the library is diagnostics-only, as the player that uses it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 95fa9aafc065d8a484bb5ee342fec9a858eea2e9)
A replay of the cell frame on an Arc A770 did its work (load from the
pipeline library, lists built, two loops, the picture) in about 15 s,
then spent about 290 s letting go of 55,853 resources, 2,600 heaps and
some 11 GB of copies one by one before it printed its report. That was
most of every replay's time after loading. Player::load now hands the
player back never to be dropped: the process ends with the replay, and
Windows takes everything back at once.

DARNER_REPLAY_PHASES=1 logs how long each part of a run takes (merge
set-up, editing and building the lists, restoring, sending, the
picture, the reports).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit f286f38700379dceeb6c4b8197ecb6d01e0a8d8f)
The first run of a turn took about 30 ms longer on an Arc A770 (the card
coming back from idle): as recorded always went first and looked 30 ms
slower than every variant. Each now goes first as often as the others.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 0ce6d49c93c10c2c0afb32862ea677db4c53879a)
As --skip-each: the first of a turn runs longer, so A and B take turns
going first. Releasing the first set's 1,077 pipelines one by one when a
compare with --shaders-b ended held its report about nine minutes; they
are kept, as the player is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit f564e2684c72a1cd18a5f484ae26f5a4e01700ff)
A prepared run keeps a speed of its own: nine identical ones of the cell
frame on an Arc A770 ran 180.3-181.2 ms but two at 187.8-188.7, and two
identical sides of a compare came out 9-17 ms apart. --replicas N
prepares each run N times, runs the instances in turn and pools their
loops, noting each instance's median.

--compare with --shaders-b made a whole second set of 1,077 pipelines
and kept both; every B instance of an A/B of identical sets then ran
4-10 ms slower than every A one (13.7 GB of the card's 14.8 in use). B
now takes A's pipelines and remakes only those with a shader from
--shaders-b: the same A/B came out -0.54 ms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit a891218f78cc774941a3a2e065763c9df38c958f)
DARNER_REPLAY_COPIES_PC=1 puts every buffer's restore copy in the PC's
memory, leaving the card's to the frame. With it the card was at 12.4 GB
of 14.7 and one replay process of six still ran the frame 13% faster:
the slow state is not the card's memory running short. Per command, the
difference is all in draws and mesh draws.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 4a5638fbca490892bb5d7130565952ea2d10a6f4)
DARNER_REPLAY_LIBRARY=compute or =graphics takes only that kind from the
replay's pipeline library and makes the other. On the Arc A770 the cell
frame took 726-732 ms with the graphics pipelines made, 890-900 with them
loaded, 718-722 with none loaded: graphics pipelines loaded from an
ID3D12PipelineLibrary draw about a third slower.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 8fb37b11227d7c828a9f3f3e08bdd511c183cc7c)
Player::load hands back a player never dropped (a replay ends with the
process); the test that loads a second one lets the first go with
ManuallyDrop::into_inner.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit a2b56551c731440fae5f23ab809d5ac8834e5550)
phase and pooled came after play.rs's test module, and the breadcrumbs'
list name was a then/unwrap_or_default chain: the all-features clippy
gate (-D warnings) refused both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit c68020cad65fbc2d19482d4e99fa9e18bbbc0209)
- DARNER_LIBRARY_GRAPHICS=0 makes graphics pipelines (vertex, mesh) in
  each run and keeps them out of the library; compute ones are still
  loaded. Off by default: in play (gfxmade-smoke) it cost 10-30 s of slow
  frames at the start and the card's time in the title's lists was the
  same as with the library.
- Replay: DARNER_REPLAY_BLOBS=<folder> keeps each pipeline's cached blob
  and makes it from that; restored that way the cell frame was as slow as
  from the library (845-903 ms against 725 made).
- Tracker: both runs.

Darner: graphics_pipeline leaves naming (darner warm) to pipeline; the replay blobs are diagnostics-only, as the player.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 6b22bdaac4485b12acd73a7a3ae92144138aba28)
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 6983bf0565733c05b5224fc910d029ca8a142c3b)
First-time contributor

A warm book still makes pipelines on the shader-RT path, and not on the RT-off path. After a
standalone preload that wrote 7,053 pipelines, median.making reads:

median.making mean.making preparing copying back frame GPU frame
RT in shaders (c3) 299 698.2 28.4 ms 9.7 ms 0.2 ms 53.3 ms
RT off (pin-a4b) 0 12.5 27.2 9.2 0 45.65
RT off, used book (pin-a4c) 0 0.17 32.75 13.1 0 52.9

So the selection the run makes in the frame is not the set the preload warmed - but only where the
title's builder is off the cores.
Over half the frame is preparing and the frame's own GPU work is
0.2 ms; dropping to 540p, a fifth of the pixels, moved the median by about a frame per second across
the evening.

The ask: is 299 a frame expected for the shader-RT path with a complete book, or does it mean the
book and the run select differently there? If it is expected, preparing will not fall on that path and
30 fps has to come from the title's own frame work rather than from warming.

**A warm book still makes pipelines on the shader-RT path, and not on the RT-off path.** After a standalone preload that wrote 7,053 pipelines, `median.making` reads: | | `median.making` | `mean.making` | preparing | copying back | frame GPU | frame | |---|---:|---:|---:|---:|---:|---:| | RT **in shaders** (`c3`) | **299** | **698.2** | 28.4 ms | 9.7 ms | **0.2 ms** | 53.3 ms | | RT **off** (`pin-a4b`) | 0 | 12.5 | 27.2 | 9.2 | 0 | 45.65 | | RT **off**, used book (`pin-a4c`) | 0 | 0.17 | 32.75 | 13.1 | 0 | 52.9 | **So the selection the run makes in the frame is not the set the preload warmed - but only where the title's builder is off the cores.** Over half the frame is preparing and the frame's own GPU work is 0.2 ms; dropping to 540p, a fifth of the pixels, moved the median by about a frame per second across the evening. **The ask:** is 299 a frame expected for the shader-RT path with a complete book, or does it mean the book and the run select differently there? If it is expected, preparing will not fall on that path and 30 fps has to come from the title's own frame work rather than from warming.
kisekinopureya force-pushed kisekinopureya/pr/graphics-library from d5b12f960f to 9c72486ed1 2026-12-03 21:13:28 +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/graphics-library:kisekinopureya-kisekinopureya/pr/graphics-library'
git switch 'kisekinopureya-kisekinopureya/pr/graphics-library'

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