Shaders: verify native two-pass recipe receipts #3101
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3101"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T05:45:17Z.
Part of #2829. Warm-replay receipts should defer a pipeline only after the native driver accepted every required pass and the referenced cache files still match. This change records pass roles explicitly, discards receipts from failed heap-window attempts before switch-form retry, and makes old incomplete indexes revalidate.
What is in it
warm_replay.rs: require distinct mesh and compute receipts, verify pass roles, and reject old v2 indexes.real.rsandshaders.rs: record accepted graphics, mesh, and compute blobs; discard failed-attempt receipts; classify legacy console VS+GS recipes as two-pass.README.md: document the two-file requirement.Tested
cargo build --offline --locked --workspacepassed on head01c2a85a.cargo test --workspace --no-fail-fast -- --test-threads=4: 2,892 passed, 0 failed, 51 ignored across 43 targets; 24 explicit GPU skips (22 require wave64; 2 require heap-window opt-in).cargo test --offline --locked -p xcl --lib warm_replay: 3 passed; legacy VS+GS classification: 1 passed; failed-attempt receipt cleanup: 1 passed.two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobspassed in the workspace suite.git diff --check 86e86fcb33f94fa5d0c809d9b50af7b84bf49cce..HEADpassed.Regression run
Both clean commits were built separately and run for 60 seconds on the same adapter with the same title hash.
scripts/smoke.ps1setsXCL_PREPARE=0, so these results cover launch and presentation, not warm-replay preparation.Not tested
The separate production-worker warm-cache sequence previously reported on head
ff893a2ewas not repeated on this rebased head. Startup-time benefit, a second prepared launch, AMD, Intel, and Wine were not tested.AI use
Codex (GPT-6.2 Sol) rebased the existing change, built and tested it, ran both smoke checks, and updated this description. Codex (GPT-6.2 Astra) reviewed the rebased diff.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T06:13:31Z.
CI follow-up for head
6a04002: the Windows no-GPU job stops while compilingcrates/xcl/benches/runtime.rswithE0451(Config::input_profileis private). The same error occurs on untouchedmainate429936c; this PR does not change that benchmark orConfig.I opened the separate two-line CI repair #3102. Its Windows CI and PR-description checks are green. Once that repair lands, I can rebase this warm-replay branch, rerun the clean-head smoke, and update this PR's evidence. Until then, #3101 remains draft.
AI use: Codex (GPT-6.2 Sol) traced both CI logs, made and tested the separate benchmark repair, and drafted this note.
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-28T06:44:25Z.
Tested
Exact
6a0400268d3b4962a9e884a0be05786d21962e71on native Windows 11 x64 build 26200.9974, Ryzen 7 3800X, and Rust 1.100.1 MSVC debug. I reran the pinned libtest built from a Git archive with one private fixture inserted. All 393 original files matched their commit blobs when the fixture was excluded.I ran
<libtest.exe> <filter> --exact --nocapture --test-threads=1separately for both filters.shaders::warm_replay::tests::missing_mesh_file_invalidates_only_its_persisted_recipeused synthetic files with production cache filenames and receipt APIs. After saving and reopening, both mesh recipes sharing a compute file and the ordinary graphics recipe all qualified for deferral. After removing only the first mesh file and reopening against a fresh inventory, only its recipe lost deferral. The second mesh and ordinary graphics recipes still qualified.shaders::warm_replay::tests::native_mesh_cache_names_make_complete_receiptspassed.2 passed, 0 failed, 0 ignored, 0 runtime skips. Both native processes exited 0, with 2,033 cases filtered out per invocation.
Not tested
Real driver cache, GPU or device creation, retail startup or smoke, the base revision, benchmarks, and the full workspace suite.
AI use
T3 Code through the Codex harness (
gpt-6.2-sol) verified the source and executable, ran the tests and wrote this report.Imported from ivall/xcl. Originally posted by bmjask on 2026-11-28T22:04:20Z.
Review: COMMENTED
Critical-review result: I found no concrete receipt-validation defect. The pass-tagged receipt identity, failed-fallback removal, v3 index, and legacy VS+GS ordering are internally consistent.
The branch currently conflicts. Please rebase and rerun the required exact-head validation; cache/receipt changes are especially sensitive to silently retaining stale artifacts, so include a cold-cache round trip on the rebased head.
Reviewed at
1ddfbcdb6cwith Codex (GPT-5).Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T22:46:32Z.
Follow-up to the rebase and cold-cache request: I rebased this PR onto
mainat7db2f391. The new head isdaf03feb, and GitHub reports it mergeable.On that head, the
warm_replaytests passed 3/3. They include a synthetic cold-cache round trip: save two native-format pass files and their receipt index, reopen a fresh inventory, then verify that complete pairs defer and incomplete or wrong-role pairs do not. The switch-form retry test passed 1/1, and the native GPU two-pass cache test passed 1/1. I updated the PR description with the full workspace counts, the same failure reproduced on clean main, and both generated clean-commit 60-second smoke blocks. Windows no-GPU CI, the PR-description check and triage all passed on this head.AI use: Codex (GPT-6.2 Sol) rebased and ran the checks; Codex (GPT-6.2 Astra) reviewed the receipt and retry invariants.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-28T23:19:03Z.
I connected the receipt checks to actual RTX 5070 driver blobs and pixel readbacks at
daf03febbab3d2a5f58d66cab5c5685d210a7d52(driver 616.92). Two synthetic NGG shaders differ by one color constant. They share the mesh graphics pass but have distinct compute passes.Both warm processes then created the live pipelines. The native draw/readbacks returned red 1.0 and 0.5 for the respective shaders, with alpha 1.0 and zero green/blue. The stock no-dispatch clear and legacy GS green controls also passed. One focused test passed with zero skips.
I extended the native two-pass fixture, wrapped synchronous pipeline creation with the production receipt capture/add/save APIs, and reopened the production index. The fixture used shader-container hashes as its two recipe identifiers and a fixed window count; it bypasses the preparation CLI's history key construction and scheduling. Cold refers to an empty XCL cache. When adapting the stock fixture, the phase variable must stay outside the XCL_ namespace (or be held constant) to avoid changing the settings key across child processes.
AI use: OpenAI Codex adapted the test-only fixture, ran the native controls and drafted this report.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-30T04:42:18Z.
Rebased onto current
mainf3bb6649; the updated head isefede780. Since main now accepts native cache filenames, this revision records the producing pass explicitly, discards receipts from failed heap-window attempts, and revalidates old receipt indexes.The full workspace run had 2,861 passed, 2 failed, and 51 ignored, with 24 explicit GPU skips. Both failures reproduced on clean main: the D16 result-register assertion and the mesh cache test’s “DXIL not compiled yet” result. The four new receipt/retry/classification tests passed.
The PR description now has generated paired 60-second smoke blocks for those exact commits. Both exited normally with no device removals or crashes; frames were 1,662 on main and 1,665 on the PR head. The smoke uses
XCL_PREPARE=0, so it does not exercise warm-replay preparation.AI use: Codex (GPT-6.2 Sol) rebased, resolved the overlap, built and tested this revision, ran the smokes, and drafted this report.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-30T05:43:43Z.
Rebased and rerun on current main
d52ff48c, at PR headff893a2e.cargo build --offline --locked --workspacepassed. The full workspace suite reported 2,878 passed, 2 failed, 51 ignored; both failing tests reproduced individually on clean main. There were 24 explicit GPU skip notices across 42 test targets.The paired 60-second smoke on the RTX 3080 Ti showed 1,664 frames on main and 1,694 on this head, with 60 presents per two-second interval at the end of both runs, zero device removals or crashes, and peak commit of 15,724 MB / 15,284 MB.
XCL_PREPARE=0, so this checks launch and presentation but does not exercise warm-replay preparation. The updated description has the exact smoke blocks and failure names. CI is running after the update.AI use: Codex (GPT-6.2 Sol) rebased and ran the checks; Codex (GPT-6.2 Astra) reviewed the final diff.
Imported from ivall/xcl. Originally posted by Gevroska on 2026-11-30T08:33:08Z.
I tested warm replay on
ff893a2eon my RTX 3080 10 GB (driver 616.92). The smoke test on this head usedXCL_PREPARE=0, so I ran two synthetic two-pass recipes through the productionxcl shadersworker. They share a mesh pass and have separate compute passes.All four processes exited successfully with zero worker failures or skips. On this head, removing one compute file invalidated only the recipe that needed it. This test covers cache recovery in the preparation worker. I didn’t measure game startup time.
I used Codex GPT-6.2 Sol to prepare the fixture, run the worker, and analyze the logs. The results were independently checked. Codex GPT-6.2 Astra drafted this comment.
I reviewed and approved this comment before posting.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-30T16:54:52Z.
Focused warm-replay tests on current head
284cda77, based directly onmain9dfbe3ea:These tests cover complete native mesh receipts, legacy graphics-receipt revalidation, and requiring both unchanged driver files. Windows 11 build 26300; CPU-only run, no GPU test. The production worker's cold/warm/missing-file sequence was previously reported on head
ff893a2eand was not repeated on this head.AI use: Codex (GPT-6.2 Sol) ran the tests; Codex (GPT-6.2 Astra) reviewed the current diff.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:30:20Z.
Triage (#1607) – head
01c2a85Follows up #2829 and the name-based mesh receipts merged in #3495 (
2308e9dc). It replaces the file-name check with explicit pass roles, drops receipts from a failed heap-window attempt before the switch-form retry, and bumps the index to v3. No open PR changeswarm_replay.rsthe same way (#3506 only changes the Wine receipt import).No problems found in the diff.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T11:13:57Z.
merge-check
base:
493dbd3dd0head:
01c2a85a83merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2903 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff (+165/-36). On main, VS+GS records were classed as single-pass and receipts were checked by file name. The two-pass mesh file is also named
gfx-..., so a mesh-pass file alone made a "complete" receipt and the compute pass was never verified; receipts from a failed heap-window attempt also stayed in the capture list. Pass roles are now recorded when the driver accepts a blob, and a misclassified recipe can only lose its receipt, never get a wrong one. Findings: (1) Cost. A two-pass receipt now needs a kept compute file (warm_replay.rs~113,shaders.rs~4002), and a compute build under 20 ms keeps none (COMPUTE_KEEP). So recipes with a fast compute pass never get a receipt and are rebuilt by the driver on every preparation run. Native mesh recipes already had this on main; console VS+GS recipes now join them. Right call, but not measured on a GS-heavy title. (2) Moving the index from v2 to v3 (~105) drops every existing receipt, valid single-pass ones included, so the next preparation runs everything once; the description could say so. The old v2 files stay on disk. (3) The new tests use the newPassAPI, so they can't run on main, though their logic covers the false accept (key 6) and the discarded retry receipt; nothing tests thegraphics_workerwiring end to end. Fine:legacy_two_pass(DS and HS empty, VS and GS console shaders) matches the real routing intranslated_graphics_pso_once.checkpoint/discard_sinceare thread-local, cheap, and skipped when no capture runs. Verification itself is unchanged (size, creation and write time against the inventory), so no extra hashing at startup.smoke.ps1setsXCL_PREPARE=0, so a smoke run doesn't reach receipt recording; no smoke run here.performance: no smoke run (the default path doesn't reach this change); not measured. Preparation-only: a smoke run (
XCL_PREPARE=0) doesn't record receipts.verdict: safe to merge (the one-time re-preparation from the v2 -> v3 index and the cost for fast compute passes are worth a line in the description)
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by stijn-boer on 2026-12-02T18:29:08Z.
merge-check
base:
c53e969602head:
01c2a85a83verdict: not yet: the focused receipt checks passed and both workspace and retail smoke runs ended early. A successful two-pass warm replay was not verified on this driver.
Windows / AMD RDNA4 (native D3D12) — warm replay and two-pass cache receipt checks on
01c2a85Clean merge onto
mainatc53e969(merge commit61c4b189b1c1ddccca0dd9218f62bfd31edb9179).git diff --checkwas clean.Setup
d3d12SDKLayers.dll, DXC 1.9.2609.5Tested
cargo build --workspacepassed.cargo test --workspace --no-fail-fast -- --test-threads=4 --show-outputexited 101 on both builds. The baseline table row is from a prior run of the same commit, machine, SDK, and command.SKIPPEDnoticesmainCounts are partial because two test processes aborted on each build.
main— none observed in comparable results.--test-threads=1 --show-output --nocapture. They cover two-pass acceptance, unchanged files, legacy receipt revalidation, and discarding a failed attempt's receipt before retry.uploads_start_from_each_subresources_statepassed.Shared failures and process aborts
fuzz_validate_and_gpu_1,fuzz_validate_and_gpu_3, andtwo_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobsreported failures on both builds.gpu_compute_e2etest processes exited with0xc0000409on both builds.Retail smoke
Ran
scripts/smoke.ps1 -Game <local folder> -Seconds 60 -Xcl <debug binary>withXCL_UMA_DRIVER=mixedfor title hash2c508222.main0xc00004090xc00004090xc0000409The higher initial startup commit did not reproduce. These exits leave warm replay behavior and frame performance unverified in retail use.
Diff review
The receipt checks distinguish graphics from the mesh and compute pair and check both files before deferring replay. The retry test verifies that receipts created by the failed attempt are discarded.
Not tested
Remaining workspace tests after the aborts, successful two-pass driver-cache replay on AMD, and retail warm-start timing.
AI use
Codex (GPT-6) merged and built the PR, ran the tests, compared the results with
main, reviewed the diff, and drafted this report.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.