NVIDIA: the picture depends on which launches filled the pipeline library (static samplers; shadows and hair wrong in the prologue cell) #1459

Open
opened 2026-11-27 11:09:52 +00:00 by KyleS98 · 1 comment
KyleS98 commented 2026-11-27 11:09:52 +00:00 (Migrated from github.com)
Contributor

Imported from fxceless/victory-fork. Originally posted by KyleS98 on 2026-11-27T11:09:52Z.


Short version. On an NVIDIA card the title's picture depends on which launches filled the pipeline library, and on whether this launch makes one more static sampler before the title's own. My reading of it: a pipeline loaded from the library samples with other static samplers than its root signature names when this launch first makes its static samplers in another order than the launch that stored it. The picture is then wrong for the whole run, with no error and no warning. Measured on an RTX 3090 Ti, driver 616.92, Windows 11 26200, Series S profile, prologue cell.

I found it through my own #1081 (its blend pass had a static sampler; that is fixed there, see the comment), but it does not need a sampler of the layer's: a library filled by launches of another configuration is enough.

What I measured

1. One more static sampler, made early, with a library filled without it (main 1f5d17a; the extra root signature is made at the first present and never bound):

the extra static sampler picture in the cell
linear, clamped, anisotropy 16, border opaque white, no last level wrong: hair bright yellow, the wall beside lit in blocks
the title's own linear clamped sampler (anisotropy 1, border transparent black, levels 0 to 12) with the last level unbounded wrong
the same with maximum anisotropy 16 wrong
the same with border opaque white wrong
the same with comparison function "less or equal" (unused by a filter that does not compare) right
none right

20 runs of 20 wrong with a sampler unlike the title's own, 0 of 12 without one or with the last row's. The title's pipelines carry 23 different static samplers in their first 2,048 root signatures; one of them is its shadow comparison sampler, and the wrong picture looks like shadow lookups made without comparison.

2. The library is what carries it (main 9a9091d with #798 and #1081, the same build and switches each time):

pipeline library picture
filled by earlier launches of another configuration (the same main without #798, where the title takes another upscaler path) wrong
empty: every pipeline compiled in this launch right
the one that launch left behind, loaded by a second launch right

3. The same again with my own test tree (9a9091d with #798, #1081, #1388, #1414; one build, the usual switches):

pipeline library picture
filled by one launch with an experiment of mine switched on (fences told early; it changes when the title does things, and that launch ended in a crash of the title 3.5 minutes in), then loaded by a launch without it wrong
empty, and the launch after it on what it left right, twice

In every "right" row the cell has dark hair, an evenly dark wall and the print on the shirt; in every "wrong" row the hair is bright yellow. Shader translations were shared between all of these (one folder); only the library differed.

What I have not done: the reverse of 1 (fill a library with the extra sampler present, then load it without).

What I think happens

The driver numbers the different static samplers of a device in the order they are first made, a compiled pipeline refers to them by number, and a pipeline stored in the library keeps the numbers of the launch that compiled it. The library's check that an entry's description is the same passes, since the description is the same: the samplers are equal by value, only their numbers on this device differ. I have no way to look inside the driver; this is the simplest thing that fits every row above.

Why it matters beyond one PR

Anything that changes the order in which different static samplers are first made, between the launch that stored a pipeline and a later one, can do this:

  • a pass of the layer's own with a static sampler that is made at another moment (the tile look pass in tiles.rs has one; #1081 had one);
  • a switch or patch that changes what the title does first (#798 did here; so did my fence experiment);
  • a new main whose pipelines of unchanged description are still in the library from an older one;
  • possibly the workers' timing or the early-pipelines list, if they change which root signature is made first. I have not shown that these do: two launches in a row of one configuration came out the same here, three times.

It would explain pictures that are wrong in some runs and right in others with no change in between, and wrong for one tester and right for another on the same commit.

What could be done

  • Cheap, and it fits the numbering guess: keep the list of static samplers ever seen beside the library, and before anything else makes a root signature, make them in that order in root signatures that live for the whole run; a new one goes to the end of the list. Libraries filled before that would have to be dropped once.
  • Independent of how the driver numbers them: no static samplers at all in translated pipelines (immediate samplers put in the sampler heap past the title's own slots).
  • At the least: nothing of the layer's own should bring a static sampler.

I can send the first as a PR if you want it; say so and I will, with the same measurements repeated on it.

Numbers and descriptions only; no game data. AI-assisted (Claude Code, Claude Fable 5.2).

<!-- greyfinch-sync:fxceless/victory-fork:issue:6645248204 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/1459). Originally posted by [KyleS98](https://github.com/KyleS98) on 2026-11-27T11:09:52Z. --- **Short version.** On an NVIDIA card the title's picture depends on which launches filled the pipeline library, and on whether this launch makes one more static sampler before the title's own. My reading of it: a pipeline loaded from the library samples with other static samplers than its root signature names when this launch first makes its static samplers in another order than the launch that stored it. The picture is then wrong for the whole run, with no error and no warning. Measured on an RTX 3090 Ti, driver 616.92, Windows 11 26200, Series S profile, prologue cell. I found it through my own #1081 (its blend pass had a static sampler; that is fixed there, see [the comment](https://github.com/fxceless/victory-fork/pull/1081#issuecomment-7216141453)), but it does not need a sampler of the layer's: a library filled by launches of another configuration is enough. ### What I measured **1. One more static sampler, made early, with a library filled without it** (`main` `1f5d17a`; the extra root signature is made at the first present and never bound): | the extra static sampler | picture in the cell | |---|---| | linear, clamped, anisotropy 16, border opaque white, no last level | wrong: hair bright yellow, the wall beside lit in blocks | | the title's own linear clamped sampler (anisotropy 1, border transparent black, levels 0 to 12) with the last level unbounded | wrong | | the same with maximum anisotropy 16 | wrong | | the same with border opaque white | wrong | | the same with comparison function "less or equal" (unused by a filter that does not compare) | right | | none | right | 20 runs of 20 wrong with a sampler unlike the title's own, 0 of 12 without one or with the last row's. The title's pipelines carry 23 different static samplers in their first 2,048 root signatures; one of them is its shadow comparison sampler, and the wrong picture looks like shadow lookups made without comparison. **2. The library is what carries it** (`main` `9a9091d` with #798 and #1081, the same build and switches each time): | pipeline library | picture | |---|---| | filled by earlier launches of another configuration (the same `main` without #798, where the title takes another upscaler path) | wrong | | empty: every pipeline compiled in this launch | right | | the one that launch left behind, loaded by a second launch | right | **3. The same again with my own test tree** (`9a9091d` with #798, #1081, #1388, #1414; one build, the usual switches): | pipeline library | picture | |---|---| | filled by one launch with an experiment of mine switched on (fences told early; it changes when the title does things, and that launch ended in a crash of the title 3.5 minutes in), then loaded by a launch without it | wrong | | empty, and the launch after it on what it left | right, twice | In every "right" row the cell has dark hair, an evenly dark wall and the print on the shirt; in every "wrong" row the hair is bright yellow. Shader translations were shared between all of these (one folder); only the library differed. What I have not done: the reverse of 1 (fill a library with the extra sampler present, then load it without). ### What I think happens The driver numbers the different static samplers of a device in the order they are first made, a compiled pipeline refers to them by number, and a pipeline stored in the library keeps the numbers of the launch that compiled it. The library's check that an entry's description is the same passes, since the description is the same: the samplers are equal by value, only their numbers on this device differ. I have no way to look inside the driver; this is the simplest thing that fits every row above. ### Why it matters beyond one PR Anything that changes the order in which different static samplers are first made, between the launch that stored a pipeline and a later one, can do this: - a pass of the layer's own with a static sampler that is made at another moment (the tile look pass in `tiles.rs` has one; #1081 had one); - a switch or patch that changes what the title does first (#798 did here; so did my fence experiment); - a new `main` whose pipelines of unchanged description are still in the library from an older one; - possibly the workers' timing or the early-pipelines list, if they change which root signature is made first. I have not shown that these do: two launches in a row of one configuration came out the same here, three times. It would explain pictures that are wrong in some runs and right in others with no change in between, and wrong for one tester and right for another on the same commit. ### What could be done - Cheap, and it fits the numbering guess: keep the list of static samplers ever seen beside the library, and before anything else makes a root signature, make them in that order in root signatures that live for the whole run; a new one goes to the end of the list. Libraries filled before that would have to be dropped once. - Independent of how the driver numbers them: no static samplers at all in translated pipelines (immediate samplers put in the sampler heap past the title's own slots). - At the least: nothing of the layer's own should bring a static sampler. I can send the first as a PR if you want it; say so and I will, with the same measurements repeated on it. Numbers and descriptions only; no game data. AI-assisted (Claude Code, Claude Fable 5.2).
KyleS98 commented 2026-11-27 11:43:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from fxceless/victory-fork. Originally posted by KyleS98 on 2026-11-27T11:43:21Z.


A fix along the first of the three lines above is in #1461: the static samplers a cache has seen are listed beside the library and made in that order before a launch's first root signature.

It also gives a way to reproduce this on other cards without my debug build: in a diagnostics build of that branch, VICTORY_SAMPLER_ORDER=0 VICTORY_EXTRA_STATIC_SAMPLER=1 on a library that was filled without the second switch makes one more unlike static sampler before the title's first root signature. Here that gives the wrong picture (bright yellow hair in the prologue's cell); the same launch with the order kept is right. Four launches, in the PR's table.

Still a guess, as said above: that the driver numbers the samplers by first use. The test shows the case that was wrong 20 times of 20 come out right; it does not show the driver.

AI-assisted (Claude Code, Claude Fable 5.2).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7217399421 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/1459#issuecomment-7217399421). Originally posted by [KyleS98](https://github.com/KyleS98) on 2026-11-27T11:43:21Z. --- A fix along the first of the three lines above is in #1461: the static samplers a cache has seen are listed beside the library and made in that order before a launch's first root signature. It also gives a way to reproduce this on other cards without my debug build: in a diagnostics build of that branch, `VICTORY_SAMPLER_ORDER=0 VICTORY_EXTRA_STATIC_SAMPLER=1` on a library that was filled without the second switch makes one more unlike static sampler before the title's first root signature. Here that gives the wrong picture (bright yellow hair in the prologue's cell); the same launch with the order kept is right. Four launches, in the PR's table. Still a guess, as said above: that the driver numbers the samplers by first use. The test shows the case that was wrong 20 times of 20 come out right; it does not show the driver. AI-assisted (Claude Code, Claude Fable 5.2).
Sign in to join this conversation.
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
fxceless/victory-fork#1459
No description provided.