Pipelines: static samplers are first made in the same order in every launch (a library filled by another configuration drew the shirt without its print) #69
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!69
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-69"
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?
@KyleS98 on GitHub · 2026-11-27 16:05 UTC · original
KyleS98:static-sampler-order→main· +403 −0 · 4 files · 1 commits · draftWhat
On an NVIDIA card a pipeline library is only good for launches that first make their static samplers in the same order as the launches that filled it. This keeps that order the same in every launch.
static-samplers.txtbeside the library (ten words a line), in the order they were first made.victory warmmakes them ahead as before.VICTORY_SAMPLER_ORDER=0: none of this.VICTORY_EXTRA_STATIC_SAMPLER=1(diagnostics builds): one more static sampler before the title's first root signature, to reproduce the fault with the order off.The hook is one call in
pipeline::host::root_signature.What went wrong, on this tree
RTX 3090 Ti, driver 616.92, Windows 11, your launcher's settings, the prologue's cell, on
959dcaf:So nothing is wrong until a launch makes its pipelines in another order than the library's; then a pipeline from the library draws wrong for the whole run, with no error. Anything that changes that order can do it: another upscaler path, a switch, a new build whose unchanged pipelines are still in the library, maybe
victory warmagainst a play session (not tested).On fxceless/victory-fork I had the same fault in another shape (bright yellow hair, shadows gone) and narrowed it there: one more static sampler unlike the title's own, made before the title's first root signature and never bound, gave the wrong picture in 20 runs of 20, against 0 of 12 without it. The write-up is fxceless/victory-fork#1459, the same change there fxceless/victory-fork#1461.
What it rests on
A guess about the driver: it numbers a device's different static samplers in the order they are first made, a compiled pipeline names them by number, and a pipeline kept in the library keeps the numbers of the launch that compiled it. I cannot look inside the driver. What I have is that the cases that went wrong come out right with the order kept. A tester on fxceless's PR ran the mechanism on Proton with vkd3d-proton and found no such dependence there, so this looks like NVIDIA's Windows driver behind the native pipeline library.
Tested
d12eb1b+ this commit), Series S, a cache of its own: first launch, no library and no list: the cell is right, the list holds 24 samplers, 27.8 fps (the FSR 4 path's rate here). Second launch: "static samplers are made in the order of this cache's list ... samplers=24", the library loaded, the cell right, 28.3 fps. No exception.cargo clippy --workspace --all-targets(with and without--all-features): the same 49 messages asmain, none in a file this touches.cargo test --workspaceon a branch with this and #68: everything passes exceptindirect::tests::host_list_budget_starts_empty_at_each_submissionandindirect::tests::warp_batch_charges_every_execution, which fail the same way on unmodifiedmainon this PC (#67 fixes them).Limits
victory warm's work.AI-assisted (Claude Code, Claude Fable 5.2); runs on my machine; no game data in the change.
@Dukestar69 on GitHub · 2026-11-27 16:31 UTC · original · approved these changes
LGTM — verified on Windows (RTX 5090):
cargo test -p victory-gpu --lib pipeline::passed (26/26, including all 3 newpipeline::samplers::tests::andpipelines_with_static_samplers_skip_the_library)cargo xtask policypassed (280 files ok)Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@fladit123 on GitHub · 2026-11-27 18:53 UTC · original · requested changes
Request changes
Thanks for investigating this driver behavior and proposing a way to preserve sampler ordering across launches.
I independently reproduced the underlying issue on an RTX 4060, driver 610.88, using the existing synthetic
lut3d_probe.rsexample.Independent validation
d12eb1b0b568e5The synthetic probe completed 12 separate executions with 768 RGB samples.
With SM 6.6 and
SHIFT=10in the reader:LoadComputePipeline, but returned the nearest-neighbor reference at all 64 coordinates.The same-order and SWAP66 controls remained correct.
This independently confirms the underlying driver symptom on Ada hardware. However, the standalone probe does not exercise the PR's ordering module or production pipeline-cache integration.
P1 — Demonstrate an actual persistent hit for the affected PSO
pipeline/library.rs:268–312retains the existing static-sampler bypass unlessVICTORY_LIBRARY_STATIC_SAMPLERS=1is set.Moreover,
pipeline()initializes the library before applying that guard. Consequently, the library-open message alone does not establish that the affected PSO was loaded rather than recreated.Could you clarify whether static-sampler persistence was enabled during your validation?
I recommend a two-process synthetic regression through the production cache path, requiring a confirmed hit for the target PSO, no creation fallback, and matching numerical readback.
P1 — Reject incompatible or incomplete cache metadata
listed_at_start()currently checks only whether the sidecar exists. Unreadable lists become empty lists, malformed entries are discarded, and failures during sampler replay or sidecar persistence only produce warnings.Additionally,
unlisted()still permits loading the previous library if removal fails.Please consider validating the sidecar against the corresponding library generation, including
host-pipelines.next, and bypassing persistent reuse whenever the required sampler order cannot be established.P1 — Separate incompatible cache writers
With ordering disabled and static-sampler persistence enabled, a process can populate the library while leaving an existing ordered sidecar unchanged.
The next ordered launch may then consider that library compatible.
A separate cache namespace for unordered configurations, together with an appropriate single-writer or generation-publication policy, would avoid silently mixing incompatible artifacts.
P2 — Establish coverage of sampler creation paths
The new hook covers the translated root-signature constructor, but other paths also create root signatures containing static samplers.
Please establish that replay happens before those paths can influence ordering, or move initialization to a suitable common entry point.
A failed auxiliary root-signature creation should also prevent the corresponding order from being treated as established.
Conclusion
The proposed approach is promising, and all focused tests passed locally. My concern is not with the motivation for the patch, but with the consistency guarantees required before relying on persistent static-sampler PSOs.
I would be happy to help validate an updated revision on my RTX 4060.
Reviewed HEAD:
0b568e5cf09ea302f86c8e086726ee0a7fa20c27.All local experiments used synthetic graphics workloads only. No game data or execution.
AI-assisted review and testing using OpenAI ChatGPT and Codex.
@KyleS98 on GitHub · 2026-11-27 19:50 UTC · original
@fladit123 you are right on the first point, and it changes what this PR has shown. Thank you for checking it.
Correction. On this tree, pipelines with static samplers skip the library unless
VICTORY_LIBRARY_STATIC_SAMPLERS=1(library::with_static_samplers, set inpipeline/host.rsfor every translated pipeline that has one). I left that unset in every run. So in my runs no pipeline with static samplers was loaded from the library, and the ordering in this PR changed nothing that was loaded.What my runs on this tree do show is narrower:
So the cause of the missing print on this tree is not shown to be sampler order. With the bypass in place it probably is not; I don't know yet what it is. My evidence for the ordering itself comes from fxceless/victory-fork, which has no such bypass (fxceless/victory-fork#1459), and your
lut3d_proberesult on Ada agrees with that.The ordering would matter here only with
VICTORY_LIBRARY_STATIC_SAMPLERS=1. That is also where it could be worth having: those pipelines could then come from the library instead of being made again at every start (about 1,360 of them, the cutscene stalls #65 describes). That needs the test you describe: two processes through the production cache path, a confirmed load of the affected pipeline, and a numerical readback.I am marking this as a draft and correcting the description. I will come back with that two-process test and with your other points addressed (metadata checks, a single writer, and the root signatures made by other paths, which must be ordered before anything else), or I will close it. Your offer to test on the 4060 is welcome.
AI-assisted (Claude Code, Claude Opus 5.5).
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.Merge
Merge the changes and update on Forgejo.