Match the primary shader container by database hash during prebuild #3521
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3521
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3521"
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?
@steven-seagull27 on GitHub · 2026-11-27 13:01 UTC · original
steven-seagull27:fix/prebuild-primary-shader-identity→main· +192 −19 · 4 files · 1 commits · openTwo DXBC containers can contain the same native program while differing in metadata. The pack already identifies its primary container by an SGD5 shader hash. Prebuild indexed by native program ID alone, so it could successfully warm a pipeline under a different key from the one requested. With multiple workers, the choice could also depend on which container decompressed first.
This change uses both the native program ID and the database hash to select the compute or vertex/mesh container. The pixel shader still uses its own native program ID. Raw inputs and missing database matches use the first matching container in input order. Pipeline creation and the key-reporting diagnostic use the same lookup.
Regression
The CLI test generates two containers, A and B, with identical native instructions and different metadata. It builds a pack with three records referencing database hashes 11 (A), 22 (B), and 33 (unindexed). It checks the exact pipeline keys for A, B, and fallback A with both one and eight workers.
Validation
Related to #2930. The change addresses ambiguous matches among containers present in the input. The eight
shader not foundrecords tracked there remain a separate question.Developed and tested with Codex assistance.
@pickles976 on GitHub · 2026-11-27 13:51 UTC · original
Linux/Wine matched A/B of exact head
c9e00b2vs base63bcca43— the regression reproduces the parent failure here and passes on the head. RTX 4060 Laptop 8 GiB, NVIDIA 590.48.1, Wine 11.0, vkd3d-proton 3.2.0 diagnostic build2576c0b4adfae4a+(relaxed-vtable; not stock certification), DXVK vendor masking disabled. No title run; no game assets used (the fixture's containers and SGD5 database are synthetic).Parent control
63bcca43+ this PR's test/manifest/lock files only (productionprebuild.rsunchanged): 0/1 FAIL atprebuild_identity.rs:119. The persisted keys file shows all three compute records under one identical key218f1d7dd72b2b405ca4e3fd6ea4db75(container A): record 1, named by database hash 22→container B, is warmed under A's key. The CLI itself ran on the physical adapter (real D3D12 pipelines), so this is the warm-miss defect end-to-end on hardware, matching your RTX 5080 result. Evidenceverify-pr3521-parent-control-63bcca4-20261127T135040Z/.Head
c9e00b2(clean worktree): 1/1 pass. Both CLI legs (--jobs 1,--jobs 8) created real pipelines and persisted exactly A, B, A(fallback) — the hash+program-ID lookup selects the right container and the fallback keeps input order. Fresh 8.39 s compile, 2.87 s test. Evidenceverify-pr3521-prebuild-identity-c9e00b2-20261127T135010Z/.Why this matters for the title on this machine (context from our guarded runs, not a matched measurement): a demand-capture trial here recorded 44 lighting compute keys prebuilt yet still demanded at runtime, plus 211
CS_RaytracingResolvevariants requested-but-unbuilt. If any of those records' containers share native programs with differently-keyed metadata twins, the parent's ID-only prebuild warms the wrong key and the runtime pays the build (or refuses) again. Your fix removes that class; whether it reduces the 211 unbuilt variants is only testable by a guarded title run after merge onto a stack cleared for runtime trials.Parent control files restored afterwards; both worktrees left clean at their exact refs. Evidence dirs under
.compat-runtime/logs/with per-run resource samples (peak GPU 250 MiB, min available RAM 10.8 GiB, min disk 15.19 GiB). AI-assisted verification, review-only; no direct PR contributions.@oddmaniv on GitHub · 2026-11-27 14:50 UTC · original
Independent verification of the PR author's shader-package parser tests at
c9e00b21440ea368d6dabc41a1f7ab63e288b79e.cargo test --locked -p victory-game --lib shaderpack::tests -- --nocaptureMain baseline pin:
63bcca43c6a00a758510398fa43096ce7e4f7df0.Windows x86_64 MSVC native runs. Local and remote source snapshots matched before and after each check. The adaptation applies the PR diff without additional source edits.
This is focused regression coverage, not the full workspace suite, a gameplay test, or an independent validation of every behavior in the PR. No new fix is claimed.
AI-assisted verification.
@andrewpozdnakov7-jpg on GitHub · 2026-11-27 14:53 UTC · original
I resolved the conflict with #2787 on
63bcca4. Combined branch0fc3158retains both PR histories. Full preparation, the warm-key shortcut, and diagnostics select the same database-matched container. Hashes are computed once per indexed container. The worker still publishes results in input order so the fallback stays deterministic.I used your A/B fixture on app-local WARP 1.0.22 and first warmed only A. I then added B and the unmatched record, which intentionally falls back to A. The control kept the correct full-preparation lookup and used only the native program ID in the shortcut. It reported all three records as warm and left one saved key. The combined branch saved both exact keys, and a repeat found all three records already warm.
The original one-worker/eight-worker regression, all 19 CLI tests, 16
victory-gametests, and the GPU shortcut/full-key equivalence test passed. Strict Clippy for the three affected crates and the asset policy also passed.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.