Skip to content

docs: what driver 621.24 does with the static sampler places - #2996

Open
fiestorra wants to merge 1 commit into
ProjectLeonida:mainfrom
fiestorra:findings-621-24
Open

fiestorra wants to merge 1 commit into
ProjectLeonida:mainfrom
fiestorra:findings-621-24

Conversation

@fiestorra

Copy link
Copy Markdown
Contributor

docs: what driver 621.24 does with the static sampler places

The note of 2026-11-27 says the fault reproduces every time, on an RTX 4060 Ti with
driver 616.64, and pipeline/places.rs is built against it. On an RTX 4090 with
621.24 it does not, and the reason is not luck:

the_check_looks_at_every_kind_of_sampler, run "make=50;host;pipe=c:1,2p"
places: "same", wrong: 0, read: [1, 2] (the samplers it should read)

the_table_of_static_samplers
host: places 0 to 15 hold [0, 1, 2, 3, …, 15]
host;make=22,20,21: places 0 to 15 hold [0, 1, 2, 3, …, 15]
on 616.64: [22, 20, 21, 0, 1, …, 12]

Three samplers made first take no place in this list's table, so a list's samplers are
numbered within the list and another run's order cannot move them - which is the fault's
mechanism, gone.

Measured without the game, with the tests' device on that card (they use
D3D12CreateDevice(None, ..), which on this machine is the Radeon iGPU - #2995).

Four of the eight #[ignore]d places tests now fail, and each is asserting 616.64; they are
named in the section so that the next person does not read the red as a regression.

Not settled, and said so in the section: whether it is per root signature, per pipeline or
per device with another rule, and it is one card.

Written with an AI assistant.

The note of 2026-11-27 says the fault reproduces every time, on an RTX 4060 Ti with
driver 616.64, and `pipeline/places.rs` is built against it. On an RTX 4090 with
621.24 it does not, and the reason is not luck:

  the_check_looks_at_every_kind_of_sampler, run "make=50;host;pipe=c:1,2p"
    places: "same", wrong: 0, read: [1, 2]     (the samplers it should read)

  the_table_of_static_samplers
    host:                places 0 to 15 hold [0, 1, 2, 3, …, 15]
    host;make=22,20,21:  places 0 to 15 hold [0, 1, 2, 3, …, 15]
    on 616.64:           [22, 20, 21, 0, 1, …, 12]

Three samplers made first take no place in this list's table, so a list's samplers are
numbered within the list and another run's order cannot move them - which is the fault's
mechanism, gone.

Measured without the game, with the tests' device on that card (they use
`D3D12CreateDevice(None, ..)`, which on this machine is the Radeon iGPU - ProjectLeonida#2995).

Four of the eight #[ignore]d places tests now fail, and each is asserting 616.64; they are
named in the section so that the next person does not read the red as a regression.

Not settled, and said so in the section: whether it is per root signature, per pipeline or
per device with another rule, and it is one card.

Written with an AI assistant.
@andrew-ai

Copy link
Copy Markdown

Independent hardware comparison at 68a2a7b09: RTX 5070, Windows NVIDIA driver 616.92. The unmodified the_table_of_static_samplers diagnostics test passed, including the NVIDIA-only assertions.

Probe sequence First 16 sampler indices read back
host 0 through 15
host;make=22,20,21 22, 20, 21, then 0 through 12
make=20,21;host 20, 21, then 0 through 13

This adds a second hardware/driver pair showing the order-dependent behavior reported on 616.64. The RTX 4090 result on 621.24 remains a separate observation. Both GPU model and driver differ between our runs, so these results alone cannot isolate a driver-version boundary. I did not measure startup cost.

Command from d3d12: cargo test --locked --profile diag -p leonida-gpu --features diagnostics --lib -- --ignored the_table_of_static_samplers --nocapture. One passed, 783 filtered. Codex-assisted.

@imShangLi

Copy link
Copy Markdown
Contributor

VERIFY-2996 — Linux, Fedora 45, no GPU device, no game files, no title

Verdict: MIXED. Records what driver 621.24 does with the static-sampler places in d3d12/docs/findings.md. All structural/checkable claims (test names, 8 #[ignore]d tests, both env vars, the cargo invocation, the feature) check out and the documentation tests pass, but the text has a small internal numerical mismatch — the prose says the 320-sampler check costs "266 ms" while the table in the same paragraph shows "257.8 ms" — and the driver behaviour itself is unverifiable here.

Head 68a2a7b0, base current main (8422def7), merge base 1fff6912, 1 file, +39/−0: d3d12/docs/findings.md.

1. What it changes

Adds a ## What driver 621.24 does with those places (2026-12-01) section to d3d12/docs/findings.md, between the 2026-11-27 static-samplers section (and its ### The precompile and the game's pipelines subsection) and ## What is next. It records that on driver 621.24 the static-sampler places no longer follow the process the way 616.64 did (which the tests assert), that four of the eight #[ignore]d pipeline::places tests fail for that reason, the cost per listed sampler (~0.62 ms each plus ~60 ms fixed), and that LEONIDA_LIBRARY_STATIC_SAMPLERS=0 skips it.

2. The claims it makes, and which ones I checked

  • The command cargo test -p leonida-gpu --features diagnostics --lib pipeline::places -- --ignored --nocapture — checked structurally. leonida-gpu has a diagnostics feature (Cargo.toml:30); pipeline::places is a lib module (pipeline/mod.rs:1240 pub(crate) mod places;); its tests are #[cfg(test)] mod tests; (places.rs:1190) and #[ignore]d, so --lib ... --ignored runs them. Valid.
  • "the NVIDIA branch of these tests never runs" when D3D12CreateDevice(None, ..) takes the iGPU — checked. The places tests early-return not an NVIDIA card: ... when the card is not NVIDIA (tests.rs:852 etc.). Consistent.
  • Test names the_table_of_static_samplers, a_stored_pipeline_reads_through_the_places_of_the_run_that_stored_it, the_check_looks_at_every_kind_of_sampler — checked; they exist (tests.rs:884, :823, :1185).
  • "Four of the eight #[ignore]d tests fail here" — checked the denominator: pipeline/places/tests.rs has exactly 8 #[ignore] markers.
  • The asserted 616.64 values — checked against the test source. the_table_of_static_samplers expects after(&[22,20,21]) = [22, 20, 21, 0, 1, …, 12] for host;make=22,20,21 (exactly the doc's "on 616.64" row) and after(&[]) = [0,1,2,3,…,15] for host. a_stored_pipeline_reads_through_the_places_of_the_run_that_stored_it expects read(&second) == [[45,46],[43,44],[40,41,42]]. the_check_looks_at_every_kind_of_sampler builds 320 listed samplers (many=300 + 20 kinds) and asserts places == "differ" after make=50. All consistent with "each is asserting 616.64".
  • LEONIDA_PLACES_RUN — checked. tests.rs:502 reads it, :757 sets it; listed in switches.md under "Read by test code alone".
  • LEONIDA_LIBRARY_STATIC_SAMPLERS=0 skips the check — checked. places.rs:1083 tests == "0".
  • "The 25 is the title's own count (the note above)" — the note above is the 2026-11-27 section, which says a work-cache sample has "25 different static samplers". Reasonable.
  • Arithmetic self-consistency — ~0.62 ms/sampler and ~60 ms base are consistent with the table: 320−25 = 295 extra samplers, 257.8−75.0 = 182.8 ms ≈ 295×0.62; 75.0−25×0.62 ≈ 59.5 ≈ 60 ms.

3. What the tests do here

  • python3 -I -m unittest discover -s tests -p "test_docs_*.py" — 57 tests, all pass (41.6 s).
  • python3 -I scripts/check_no_game_data.py d3d12/docs/findings.md — exit 0.
  • python3 -I scripts/red_green.py 2996 --no-cargo — "red not constructible: the pull request changes no test" (expected for a docs-only change).
  • git merge-tree --write-tree origin/main pr2996 — merges cleanly.

4. Anything wrong in the text

  • d3d12/docs/findings.md:636 and :638 vs the table at :632 — the prose says "the 320 is the list the_check_looks_at_every_kind_of_sampler builds, and its 266 ms is what that list costs" and "for about 75 ms of a start on this driver, not 266", but the table's 320-sampler row (line 632) shows 257.8 ms. Either 266 is a different phase of the same run (the test prints three times: stored, first held against, then) or one of the two numbers is a typo. As written, the prose and the table disagree on what the 320-sampler check costs, and the doc does not say they are different phases. Worth the author reconciling. (The 25-row's 75.0 ms does match the prose's "about 75 ms".)
  • Style is otherwise consistent: ## ... (date) heading, **bold** lead-ins, 4-space code/table blocks, wraps ~100–113 chars like the file, no duplicated lines, and the section is inserted before ## What is next (which stays last). No table of contents to update.

5. What I did not check

  • The driver behaviour itself: that 621.24 returns [0,1,2,3,…,15] for host;make=22,20,21, that the two named tests read the values quoted, the timings (75.0/257.8 ms, ~0.62 ms/sampler), and that four of eight tests fail — all need the RTX 4090 / driver 621.24. I checked only that the tests assert the 616.64 behaviour the doc describes and that the command would run them.
  • The #2995 cross-reference — I cannot read it (no GitHub access); it appears only here in the repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants