d3d12 tests: run the six longest loops with smaller counts under Miri #599

Merged
snoozedDev merged 1 commit from upstream-pr/599 into main 2026-11-30 20:41:29 +00:00
snoozedDev commented 2026-11-30 20:13:06 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by snoozedDev on 2026-11-30T20:13:06Z.


Summary

The Miri job sets the length of every CI run: 7 min 12 s on 58738995 (run 46490891342), against 1.6 to 2.5 min for the other jobs. In that run the d3d12 tests take 347.86 s of the job. Six of them loop to production sizes and take most of that time.

Under Miri only, this PR uses smaller sizes:

  • device/heap_page_cache.rs: LIMIT is 256 instead of 4096.
  • commands/memory_wait.rs: WrittenRanges::MAX_NAMED is 64 instead of 1024.
  • recorded_writes test: 2,000 lists instead of 10,000. That is still more than the test's bound of 1,000 kept writes, and the assertion message now names the count it ran.
  • placement::pending test: 50 random probes instead of 500.

Builds and test runs outside Miri keep today's values, and Miri never builds the provider DLLs. The two limits are compile-time constants, so the tests can't pick a smaller size themselves without a new field on the structs that use them.

Follows the slow-test item on #369.

This contribution was written by an AI agent (Claude Opus 5.5) operating under my supervision. I am accountable for it and will respond to review.

Tested

Run the checks relevant to this change.

  • The checks relevant to this change passed
  • Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below
  • Where the table calls for AMD and NVIDIA, they passed on both. Otherwise, say which vendor still needs to run them: neither. No GPU check was run: nothing outside Miri changes, so there is no GPU behaviour to check.

No Lanes scenario covers this because it changes test time only; nothing a game or Lanes runs changes. I didn't launch the game.

GPU, driver and backend: none (CPU-only).

The Evidence: line tuxbox.py check prints last, one per card (it names the commit it tested; run it on this pull request's head):

Evidence: TuxBox check of 0a1d96c37a6e, no uncommitted changes, no GPU checks: 12 passed, 0 failed, 1 not run

(The one not run is the synthetic shaders through the runtime's DXC flags, which needs a Linux DXC that wasn't on PATH for this run.)

Commands run and their results:

MIRIFLAGS="-Zmiri-permissive-provenance -Zmiri-disable-isolation -Zmiri-ignore-leaks" \
  cargo +nightly miri test --locked --target x86_64-pc-windows-msvc --lib -p tuxbox-d3d12 \
  -- -Zunstable-options --report-time

before (d00006b2): 328 passed; 0 failed; 159 ignored; finished in 327.20s
after:             328 passed; 0 failed; 159 ignored; finished in 114.03s
test before (s) after (s)
heap_page_cache sweep_reaches_expired_key_behind_live_entries 48.7 2.6
recorded_writes what_has_run_or_is_gone_is_dropped 42.7 8.6
memory_wait named_ranges_survive_an_unknown_write_and_merging 40.2 0.2
heap_page_cache full_cache_replaces_same_key_without_duplicate_queue_entries 38.0 2.1
heap_page_cache failed_imports_are_not_cached_and_live_entries_are_bounded 37.8 2.2
placement::pending the_index_finds_exactly_the_overlapping_ranges 20.3 3.0
the six 227.6 18.6

The tests still catch what they check at the smaller sizes. Under Miri, with note never dropping the writes of lists that are gone, what_has_run_or_is_gone_is_dropped fails with "2001 writes are kept after 2000 lists came and went". With the page-cache sweep never removing an expired entry, sweep_reaches_expired_key_behind_live_entries and failed_imports_are_not_cached_and_live_entries_are_bounded fail.

Also run:

  • cargo +1.95.0 clippy --locked --target x86_64-pc-windows-msvc --workspace --all-targets -- -D warnings and cargo fmt --all --check: pass.
  • d3d12 unit tests built with cargo xwin test and run under plain Wine (full sizes): 476 passed, 8 ignored, 3 failed. The six above pass. The 3 are the scene_publication tests, which panic with "hardware device required" because plain Wine can't create the device. They fail the same way on main.
  • Miri ran on nightly 2026-11-29 here; CI pins nightly-2026-11-03. I'll post this PR's own Miri job time as a comment once its CI has run.

Checks

CI runs the code checks: the Python and Rust unit tests, the translator tests through DXC, a Windows typecheck, clippy, formatting, rustdoc, and Miri on the providers. It has no GPU.

If this pull request changes evidence JSON, regenerate the results table and the progress map and include both files:

python tuxbox.py status > docs/RESULTS.md
python tuxbox.py status --svg docs/progress.svg

This pull request changes no evidence JSON.

<!-- greyfinch-sync:brcly/TuxBox:issue:5572956800 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/599). Originally posted by [snoozedDev](https://github.com/snoozedDev) on 2026-11-30T20:13:06Z. --- ## Summary The Miri job sets the length of every CI run: 7 min 12 s on 58738995 ([run 46490891342](https://github.com/brcly/TuxBox/actions/runs/46490891342)), against 1.6 to 2.5 min for the other jobs. In that run the d3d12 tests take 347.86 s of the job. Six of them loop to production sizes and take most of that time. Under Miri only, this PR uses smaller sizes: - `device/heap_page_cache.rs`: `LIMIT` is 256 instead of 4096. - `commands/memory_wait.rs`: `WrittenRanges::MAX_NAMED` is 64 instead of 1024. - `recorded_writes` test: 2,000 lists instead of 10,000. That is still more than the test's bound of 1,000 kept writes, and the assertion message now names the count it ran. - `placement::pending` test: 50 random probes instead of 500. Builds and test runs outside Miri keep today's values, and Miri never builds the provider DLLs. The two limits are compile-time constants, so the tests can't pick a smaller size themselves without a new field on the structs that use them. Follows the slow-test item on #369. This contribution was written by an AI agent (Claude Opus 5.5) operating under my supervision. I am accountable for it and will respond to review. ## Tested Run the [checks relevant to this change](../CONTRIBUTING.md#test-what-your-change-touches). - [x] The checks relevant to this change passed - [x] Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below - [ ] Where the table calls for AMD and NVIDIA, they passed on both. Otherwise, say which vendor still needs to run them: neither. No GPU check was run: nothing outside Miri changes, so there is no GPU behaviour to check. No Lanes scenario covers this because it changes test time only; nothing a game or Lanes runs changes. I didn't launch the game. GPU, driver and backend: none (CPU-only). The `Evidence:` line `tuxbox.py check` prints last, one per card (it names the commit it tested; run it on this pull request's head): ```text Evidence: TuxBox check of 0a1d96c37a6e, no uncommitted changes, no GPU checks: 12 passed, 0 failed, 1 not run ``` (The one not run is the synthetic shaders through the runtime's DXC flags, which needs a Linux DXC that wasn't on `PATH` for this run.) Commands run and their results: ```text MIRIFLAGS="-Zmiri-permissive-provenance -Zmiri-disable-isolation -Zmiri-ignore-leaks" \ cargo +nightly miri test --locked --target x86_64-pc-windows-msvc --lib -p tuxbox-d3d12 \ -- -Zunstable-options --report-time before (d00006b2): 328 passed; 0 failed; 159 ignored; finished in 327.20s after: 328 passed; 0 failed; 159 ignored; finished in 114.03s ``` | test | before (s) | after (s) | |---|---|---| | `heap_page_cache` `sweep_reaches_expired_key_behind_live_entries` | 48.7 | 2.6 | | `recorded_writes` `what_has_run_or_is_gone_is_dropped` | 42.7 | 8.6 | | `memory_wait` `named_ranges_survive_an_unknown_write_and_merging` | 40.2 | 0.2 | | `heap_page_cache` `full_cache_replaces_same_key_without_duplicate_queue_entries` | 38.0 | 2.1 | | `heap_page_cache` `failed_imports_are_not_cached_and_live_entries_are_bounded` | 37.8 | 2.2 | | `placement::pending` `the_index_finds_exactly_the_overlapping_ranges` | 20.3 | 3.0 | | the six | 227.6 | 18.6 | The tests still catch what they check at the smaller sizes. Under Miri, with `note` never dropping the writes of lists that are gone, `what_has_run_or_is_gone_is_dropped` fails with "2001 writes are kept after 2000 lists came and went". With the page-cache sweep never removing an expired entry, `sweep_reaches_expired_key_behind_live_entries` and `failed_imports_are_not_cached_and_live_entries_are_bounded` fail. Also run: - `cargo +1.95.0 clippy --locked --target x86_64-pc-windows-msvc --workspace --all-targets -- -D warnings` and `cargo fmt --all --check`: pass. - d3d12 unit tests built with `cargo xwin test` and run under plain Wine (full sizes): 476 passed, 8 ignored, 3 failed. The six above pass. The 3 are the `scene_publication` tests, which panic with "hardware device required" because plain Wine can't create the device. They fail the same way on main. - Miri ran on nightly 2026-11-29 here; CI pins nightly-2026-11-03. I'll post this PR's own Miri job time as a comment once its CI has run. ## Checks CI runs the [code checks](../CONTRIBUTING.md#code-checks): the Python and Rust unit tests, the translator tests through DXC, a Windows typecheck, clippy, formatting, rustdoc, and Miri on the providers. It has no GPU. If this pull request changes evidence JSON, regenerate the results table and the progress map and include both files: ```sh python tuxbox.py status > docs/RESULTS.md python tuxbox.py status --svg docs/progress.svg ``` This pull request changes no evidence JSON.
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
brcly/TuxBox!599
No description provided.