D3D12.X: honor XCL_FRAME_DUMP=0 to disable periodic frame dumps #3247

Merged
Saksukella merged 1 commit from upstream-pr/3247 into main 2026-11-29 12:20:37 +00:00
Saksukella commented 2026-11-29 00:02:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Saksukella on 2026-11-29T00:02:59Z.


Setting XCL_FRAME_DUMP=0 (or false, off, or an empty value) previously fell back to 120 in frame_dump_due() because v.parse().ok().filter(|&n| n > 1).unwrap_or(120) mapped 0 to None and then 120. This change extracts parse_frame_dump_every() so 0, false, off, and empty values disable periodic BMP frame dumps while preserving XCL_FRAME_DUMP=1 (every 120th frame) and XCL_FRAME_DUMP=n (n > 1).

What is in it

  • crates/xcl/src/hle/d3d12x/present.rs:
    • Extract parse_frame_dump_every(val: Option<&str>) -> u64 and use it in frame_dump_due() so 0, false, off, and empty strings return 0 instead of falling back to 120.
    • Add unit test parse_frame_dump_every_disables_zero_false_off_and_empty.

Tested

  • Hardware: AMD Radeon RX 9070 XT (driver 32.0.32029.2010), AMD Ryzen 9 7900X, 32 GB RAM, Windows 11 Pro (build 26200), rustc 1.100.0 (0ef1bc386 2026-11-09); debug (tests) and release (xcl.exe).
  • cargo test --lib -p xcl hle::d3d12x::present -- --test-threads=4: 23 passed, 0 failed, 0 ignored (0.05s), including parse_frame_dump_every_disables_zero_false_off_and_empty.
  • cargo check --workspace: passed.

Regression run

xcl-smoke v1
commit: 227d2cb388f103268dac7635ea720eb3e5352d4e
gpu: AMD Radeon RX 9070 XT
title: b8db18c2
seconds: 60
exit: 0x0
frames shown: 1674 (PresentX 1674)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17279 MB
xcl-smoke v1
commit: 5179437baef08f5c84bc15a85a7e7f7626c98022
gpu: AMD Radeon RX 9070 XT
title: b8db18c2
seconds: 60
exit: 0x0
frames shown: 1695 (PresentX 1695)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 16895 MB

Not tested

  • NVIDIA and Intel GPU adapters (tested on AMD Radeon RX 9070 XT only).
  • Full cargo test --workspace run (targeted hle::d3d12x::present suite + cargo check --workspace + 60s TitleID 7952987A smoke run were executed).

AI use

  • Assisted with unit test authoring and PR preparation; all diffs, tests, and hardware smoke runs were verified locally.
<!-- greyfinch-sync:ivall/xcl:issue:5545859116 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3247). Originally posted by [Saksukella](https://github.com/Saksukella) on 2026-11-29T00:02:59Z. --- Setting `XCL_FRAME_DUMP=0` (or `false`, `off`, or an empty value) previously fell back to `120` in `frame_dump_due()` because `v.parse().ok().filter(|&n| n > 1).unwrap_or(120)` mapped `0` to `None` and then `120`. This change extracts `parse_frame_dump_every()` so `0`, `false`, `off`, and empty values disable periodic BMP frame dumps while preserving `XCL_FRAME_DUMP=1` (every 120th frame) and `XCL_FRAME_DUMP=n` (`n > 1`). **What is in it** - `crates/xcl/src/hle/d3d12x/present.rs`: - Extract `parse_frame_dump_every(val: Option<&str>) -> u64` and use it in `frame_dump_due()` so `0`, `false`, `off`, and empty strings return `0` instead of falling back to `120`. - Add unit test `parse_frame_dump_every_disables_zero_false_off_and_empty`. **Tested** - Hardware: AMD Radeon RX 9070 XT (driver `32.0.32029.2010`), AMD Ryzen 9 7900X, 32 GB RAM, Windows 11 Pro (build `26200`), `rustc 1.100.0 (0ef1bc386 2026-11-09)`; debug (tests) and release (`xcl.exe`). - `cargo test --lib -p xcl hle::d3d12x::present -- --test-threads=4`: 23 passed, 0 failed, 0 ignored (`0.05s`), including `parse_frame_dump_every_disables_zero_false_off_and_empty`. - `cargo check --workspace`: passed. **Regression run** ``` xcl-smoke v1 commit: 227d2cb388f103268dac7635ea720eb3e5352d4e gpu: AMD Radeon RX 9070 XT title: b8db18c2 seconds: 60 exit: 0x0 frames shown: 1674 (PresentX 1674) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17279 MB ``` ``` xcl-smoke v1 commit: 5179437baef08f5c84bc15a85a7e7f7626c98022 gpu: AMD Radeon RX 9070 XT title: b8db18c2 seconds: 60 exit: 0x0 frames shown: 1695 (PresentX 1695) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 16895 MB ``` **Not tested** - NVIDIA and Intel GPU adapters (tested on AMD Radeon RX 9070 XT only). - Full `cargo test --workspace` run (targeted `hle::d3d12x::present` suite + `cargo check --workspace` + 60s `TitleID 7952987A` smoke run were executed). **AI use** - Assisted with unit test authoring and PR preparation; all diffs, tests, and hardware smoke runs were verified locally.
Kalmarv commented 2026-11-29 01:09:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-29T01:09:23Z.


merge-check
base: fa204595a4
head: 5179437bae
merge: clean (trial merge 7e23fb95e425701fbd4cc270b36d208e7644018b, local, not pushed; git diff --check clean)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609) -> 2609 passed, 0 failed, 49 ignored; SKIPPED: 26 (21 no wave64 on this 32-lane GPU, 3 per-lane f16/f32 forms refused (#1426 semantics), 2 no heap windows); failing: none. The new present::tests::parse_frame_dump_every_disables_zero_false_off_and_empty ran and passed.
review: none blocking; whole diff read (present.rs only). On main, XCL_FRAME_DUMP=0 parses to 0, fails the n > 1 filter and falls back to 120, so it turns dumps on. With the PR, 0, empty, false and off (trimmed, case-insensitive) turn them off. 1 and other non-numbers still mean every 120th frame, and n > 1 means every n-th; unset is unchanged (off). An empty XCL_FRAME_DUMP= also changes from on to off, which matches how other flags here treat an empty value. No script in the repo sets it to 0 or empty (scratch harnesses that pass 0 simply don't set it). Nits: the new fn was inserted between frame_dump_due's /// doc lines and frame_dump_due, so that doc now attaches to parse_frame_dump_every. README (line 411) still describes only N > 1.
performance: no change when the variable is unset (the default). Title run of the merge (release, scratch/fast-world.py fast profile with XCL_FRAME_DUMP=0 set explicitly): exit 0, 0 crashes, 0 device removals, world entry 96.8 s, peak commit 29,217 MB, 66 WARN lines. The only new WARN kind against a main fa204595 run is the harness's own stop-file stop (with dumps off it stops on the steady timer); failed_pipelines 0, no translation errors. 0 present: frame N ... written to frame_N.bmp lines, where main runs of this harness with dumps on log about 48. I did not run main with =0; that main dumps every 120th frame then is read from the code. Timing differences between runs on this shared machine are noise.
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74, wave32 only), AMD Ryzen 9 9950X, Windows 11 build 26200; rustc 1.99.0, debug test profile, release build for the title run, DXC 1.9.2609 via XCL_DXC_DIR. Claude Code, Claude Opus 5.5: merge, build, suite, title run and full-diff review; this report.

<!-- greyfinch-sync:ivall/xcl:comment:7248597415 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3247#issuecomment-7248597415). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-29T01:09:23Z. --- merge-check base: fa204595a488c60c6c5f905244f0172072c9c2a9 head: 5179437baef08f5c84bc15a85a7e7f7626c98022 merge: clean (trial merge 7e23fb95e425701fbd4cc270b36d208e7644018b, local, not pushed; `git diff --check` clean) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609) -> 2609 passed, 0 failed, 49 ignored; SKIPPED: 26 (21 no wave64 on this 32-lane GPU, 3 per-lane f16/f32 forms refused (#1426 semantics), 2 no heap windows); failing: none. The new `present::tests::parse_frame_dump_every_disables_zero_false_off_and_empty` ran and passed. review: none blocking; whole diff read (`present.rs` only). On main, `XCL_FRAME_DUMP=0` parses to 0, fails the `n > 1` filter and falls back to 120, so it turns dumps on. With the PR, `0`, empty, `false` and `off` (trimmed, case-insensitive) turn them off. `1` and other non-numbers still mean every 120th frame, and `n > 1` means every n-th; unset is unchanged (off). An empty `XCL_FRAME_DUMP=` also changes from on to off, which matches how other flags here treat an empty value. No script in the repo sets it to `0` or empty (scratch harnesses that pass `0` simply don't set it). Nits: the new fn was inserted between `frame_dump_due`'s `///` doc lines and `frame_dump_due`, so that doc now attaches to `parse_frame_dump_every`. README (line 411) still describes only `N > 1`. performance: no change when the variable is unset (the default). Title run of the merge (release, scratch/fast-world.py fast profile with `XCL_FRAME_DUMP=0` set explicitly): exit 0, 0 crashes, 0 device removals, world entry 96.8 s, peak commit 29,217 MB, 66 WARN lines. The only new WARN kind against a main fa204595 run is the harness's own stop-file stop (with dumps off it stops on the steady timer); `failed_pipelines` 0, no translation errors. 0 `present: frame N ... written to frame_N.bmp` lines, where main runs of this harness with dumps on log about 48. I did not run main with `=0`; that main dumps every 120th frame then is read from the code. Timing differences between runs on this shared machine are noise. verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74, wave32 only), AMD Ryzen 9 9950X, Windows 11 build 26200; rustc 1.99.0, debug test profile, release build for the title run, DXC 1.9.2609 via XCL_DXC_DIR. Claude Code, Claude Opus 5.5: merge, build, suite, title run and full-diff review; this report.
throny commented 2026-11-29 08:41:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-29T08:41:49Z.


merge-check claim
head: 5179437bae

<!-- greyfinch-sync:ivall/xcl:comment:7253272256 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3247#issuecomment-7253272256). Originally posted by [throny](https://github.com/throny) on 2026-11-29T08:41:49Z. --- merge-check claim head: 5179437baef08f5c84bc15a85a7e7f7626c98022
throny commented 2026-11-29 09:01:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-29T09:01:05Z.


merge-check
base: d8bd9a38
head: 5179437bae
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2619 passed, 0 failed, 49 ignored (27 SKIPPED lines). Base alone at d8bd9a38: 2618 passed, 0 failed, 49 ignored.
review: no finding. XCL_FRAME_DUMP set to 0, empty, false or off now turns the periodic dumps off (on main these meant every 120th frame); nothing else reads the variable. Nit: the new function sits between frame_dump_due's doc comment and that function, so the comment now documents the wrong one. The README line on the variable could mention 0.
performance: none.
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7253479961 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3247#issuecomment-7253479961). Originally posted by [throny](https://github.com/throny) on 2026-11-29T09:01:05Z. --- merge-check base: d8bd9a38 head: 5179437baef08f5c84bc15a85a7e7f7626c98022 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2619 passed, 0 failed, 49 ignored (27 SKIPPED lines). Base alone at d8bd9a38: 2618 passed, 0 failed, 49 ignored. review: no finding. `XCL_FRAME_DUMP` set to 0, empty, false or off now turns the periodic dumps off (on main these meant every 120th frame); nothing else reads the variable. Nit: the new function sits between `frame_dump_due`'s doc comment and that function, so the comment now documents the wrong one. The README line on the variable could mention 0. performance: none. verdict: safe to merge hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
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
xcl-dev/xcl!3247
No description provided.