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

Closed
KyleS98 wants to merge 1 commit from upstream-pr/69 into main
KyleS98 commented 2026-11-27 16:05:52 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by KyleS98 on 2026-11-27T16:05:52Z.


Correction (2026-11-27, after review): on this tree, pipelines with static samplers already skip the library unless VICTORY_LIBRARY_STATIC_SAMPLERS=1, which was unset in every run below. So the ordering here changed no pipeline that was loaded from the library, and the in-game rows on this tree show only that a fresh library (or this PR's one-time drop of an unlisted one) brought the print back, not that sampler order was the cause here. The ordering matters on this tree only together with VICTORY_LIBRARY_STATIC_SAMPLERS=1; that is not tested yet. Draft until it is. Details in the comments.

What

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.

  • The static samplers a cache has seen are listed in static-samplers.txt beside the library (ten words a line), in the order they were first made.
  • Before a launch's first root signature each listed sampler is made again in that order, alone in a root signature that lives for the run.
  • A sampler not listed yet goes to the list's end; its own root signature is made under the same lock, before the root signature that asked for it.
  • A library with no list beside it was filled in whatever order its launches had: it is let go once (a log line says so) and its pipelines are made again. The pipeline book is untouched, so victory warm makes 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:

launch, in this order, on one cache folder the print on the back of the shirt
Series S (FSR 4) there
Series X, native 1440p there
Series X, scene 1080p there
Series S with the title's own upscaler (#68) missing in every screenshot
the same build, a pipeline library of its own there
the first cache again, with this change (library let go, list written) there, in two launches

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 warm against 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

  • Unit: three tests in the module (a sampler's line; a list's order and a line cut short; on the host device, a new sampler goes to the file's end and a second start reads the same order back).
  • In the game, this branch alone (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 as main, none in a file this touches.
  • cargo test --workspace on a branch with this and #68: everything passes except indirect::tests::host_list_budget_starts_empty_at_each_submission and indirect::tests::warp_batch_charges_every_execution, which fail the same way on unmodified main on this PC (#67 fixes them).

Limits

  • One card, one driver.
  • The first launch after this lands makes every pipeline again, since the old library is let go. With the pipeline book that is victory warm's work.
  • Two launches at once on one cache folder could write the list in two orders. Not guarded against.

AI-assisted (Claude Code, Claude Fable 5.2); runs on my machine; no game data in the change.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5529629418 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/69). Originally posted by [KyleS98](https://github.com/KyleS98) on 2026-11-27T16:05:52Z. --- > **Correction (2026-11-27, after review):** on this tree, pipelines with static samplers already skip the library unless `VICTORY_LIBRARY_STATIC_SAMPLERS=1`, which was unset in every run below. So the ordering here changed no pipeline that was loaded from the library, and the in-game rows on this tree show only that a fresh library (or this PR's one-time drop of an unlisted one) brought the print back, **not** that sampler order was the cause here. The ordering matters on this tree only together with `VICTORY_LIBRARY_STATIC_SAMPLERS=1`; that is not tested yet. Draft until it is. Details in the comments. ## What 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. - The static samplers a cache has seen are listed in `static-samplers.txt` beside the library (ten words a line), in the order they were first made. - Before a launch's first root signature each listed sampler is made again in that order, alone in a root signature that lives for the run. - A sampler not listed yet goes to the list's end; its own root signature is made under the same lock, before the root signature that asked for it. - A library with no list beside it was filled in whatever order its launches had: it is let go once (a log line says so) and its pipelines are made again. The pipeline book is untouched, so `victory warm` makes 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`: | launch, in this order, on one cache folder | the print on the back of the shirt | |---|---| | Series S (FSR 4) | there | | Series X, native 1440p | there | | Series X, scene 1080p | there | | Series S with the title's own upscaler (#68) | **missing in every screenshot** | | the same build, a pipeline library of its own | there | | the first cache again, with this change (library let go, list written) | there, in two launches | 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 warm` against 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 - Unit: three tests in the module (a sampler's line; a list's order and a line cut short; on the host device, a new sampler goes to the file's end and a second start reads the same order back). - In the game, this branch alone (`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 as `main`, none in a file this touches. - `cargo test --workspace` on a branch with this and #68: everything passes except `indirect::tests::host_list_budget_starts_empty_at_each_submission` and `indirect::tests::warp_batch_charges_every_execution`, which fail the same way on unmodified `main` on this PC (#67 fixes them). ## Limits - One card, one driver. - The first launch after this lands makes every pipeline again, since the old library is let go. With the pipeline book that is `victory warm`'s work. - Two launches at once on one cache folder could write the list in two orders. Not guarded against. AI-assisted (Claude Code, Claude Fable 5.2); runs on my machine; no game data in the change.
Dukestar69 commented 2026-11-27 16:31:52 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-27T16:31:52Z.

Review: APPROVED


LGTM — verified on Windows (RTX 5090):

  • cargo test -p victory-gpu --lib pipeline:: passed (26/26, including all 3 new pipeline::samplers::tests:: and pipelines_with_static_samplers_skip_the_library)
  • 0 new compiler warnings in touched files
  • cargo xtask policy passed (280 files ok)

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6091020195 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/69#pullrequestreview-6091020195). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-27T16:31:52Z. **Review:** APPROVED --- LGTM — verified on Windows (RTX 5090): - `cargo test -p victory-gpu --lib pipeline::` passed (26/26, including all 3 new `pipeline::samplers::tests::` and `pipelines_with_static_samplers_skip_the_library`) - 0 new compiler warnings in touched files - `cargo xtask policy` passed (`280 files ok`) Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
fladit123 commented 2026-11-27 18:53:44 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by fladit123 on 2026-11-27T18:53:44Z.

Review: CHANGES_REQUESTED


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.rs example.

Independent validation

Test Base d12eb1b PR 0b568e5
victory-gpu pipeline tests 23/23 26/26
victory-pipeline tests 7/7 7/7

The synthetic probe completed 12 separate executions with 768 RGB samples.

With SM 6.6 and SHIFT=10 in the reader:

  • A freshly created PSO matched the linear reference at all 64 coordinates.
  • The persisted PSO was successfully recovered through LoadComputePipeline, but returned the nearest-neighbor reference at all 64 coordinates.
  • Only 2/64 samples remained within the linear tolerance of 0.0003.
  • The maximum printed RGB difference was 0.0154.

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–312 retains the existing static-sampler bypass unless VICTORY_LIBRARY_STATIC_SAMPLERS=1 is 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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6092292762 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/69#pullrequestreview-6092292762). Originally posted by [fladit123](https://github.com/fladit123) on 2026-11-27T18:53:44Z. **Review:** CHANGES_REQUESTED --- **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.rs` example. ### Independent validation | Test | Base `d12eb1b` | PR `0b568e5` | |---|---:|---:| | victory-gpu pipeline tests | 23/23 | 26/26 | | victory-pipeline tests | 7/7 | 7/7 | The synthetic probe completed 12 separate executions with 768 RGB samples. With SM 6.6 and `SHIFT=10` in the reader: - A freshly created PSO matched the linear reference at all 64 coordinates. - The persisted PSO was successfully recovered through `LoadComputePipeline`, but returned the nearest-neighbor reference at all 64 coordinates. - Only 2/64 samples remained within the linear tolerance of 0.0003. - The maximum printed RGB difference was 0.0154. 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–312` retains the existing static-sampler bypass unless `VICTORY_LIBRARY_STATIC_SAMPLERS=1` is 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 commented 2026-11-27 19:50:46 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by KyleS98 on 2026-11-27T19:50:46Z.


@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 in pipeline/host.rs for 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:

  • A library filled by launches of other configurations: the shirt's print was missing.
  • A fresh library: the print was there.
  • This PR's "a library without a list is let go once" step has the same effect as a fresh library, and that step is all my two launches here exercised.

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_probe result 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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7226926575 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/69#issuecomment-7226926575). Originally posted by [KyleS98](https://github.com/KyleS98) on 2026-11-27T19:50:46Z. --- @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 in `pipeline/host.rs` for 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: - A library filled by launches of other configurations: the shirt's print was missing. - A fresh library: the print was there. - This PR's "a library without a list is let go once" step has the same effect as a fresh library, and that step is all my two launches here exercised. 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_probe` result 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).
trustno1-coder commented 2026-11-28 18:27:22 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-28T18:27:22Z.


Thanks for this. I'm closing it without merging because it conflicts with the current main in the files it changes, and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request. Thanks for the work.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7243803243 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/69#issuecomment-7243803243). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-11-28T18:27:22Z. --- Thanks for this. I'm closing it without merging because it conflicts with the current main in the files it changes, and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request. Thanks for the work.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
trustno1-coder/VIctory-NVIDIA!69
No description provided.