D3D12.X: XCL_DUMP_ON=<file> dumps the next frames each time the file appears #3458

Merged
lucsoft merged 1 commit from upstream-pr/3458 into main 2026-11-30 23:17:42 +00:00
lucsoft commented 2026-11-29 20:06:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by lucsoft on 2026-11-29T20:06:24Z.


XCL_DUMP_TARGETS dumps the first busy frames, or the first ones after XCL_DUMP_AFTER_S seconds. Whether a given second lands on the scene you want to look at depends on load times and on how fast you get there. In practice the dump usually misses it, and every miss costs a restart. XCL_DUMP_ON=<file> lets the dump wait for a file instead: touch it at the scene, and the next frames are dumped. You can ask again later in the same run.

What is in it

  • crates/xcl/src/hle/d3d12x/targets.rs: XCL_DUMP_ON=<file>.
    • Every 15th present checks for the file. When the file is there and can be removed, the next frames frames with at least work draws and dispatches are dumped. Both values come from XCL_DUMP_TARGETS, which stays required.
    • After that, the trigger waits for the file again.
    • Removing the file is what makes each touch ask for exactly one dump.
    • XCL_DUMP_AFTER_S is not used when XCL_DUMP_ON is set.
    • The path is the title process's own: under Wine, Z:\tmp\dump for /tmp/dump.
  • A log line when the file is found.
  • A unit test, a_file_asks_for_one_dump_and_is_looked_for_every_fifteenth_present. It covers the check cadence, that the file is removed, that one file asks once, and that the file trigger does not use XCL_DUMP_AFTER_S.
  • The module docs and the XCL_DUMP_TARGETS paragraph in README.md.

Without XCL_DUMP_ON, nothing changes.

Tested

  • Linux: NixOS, kernel 7.3.5, RX 7800 XT (RADV, Mesa 26.3.1), Ryzen 7 7800X3D, Rust 1.95.0 (nixpkgs), release, cross build to x86_64-pc-windows-gnu.
  • cargo build --release -p xcl and cargo test --release -p xcl --no-run succeed on this head.
  • The targets unit tests, run under Wine 11.21 (xcl-….exe targets::): 11 passed, 0 failed, 0 ignored, including the new one. The full workspace suite was not run.
  • Retail title under Wine with this change on a local stack (the same code, before this cleanup): XCL_DUMP_ON=Z:\tmp\xclq\dump-now XCL_DUMP_TARGETS=2000,3,24, two touches in one run, about 150 frames apart. Each touch dumped 3 frames with 24 targets each (frames 2370–2373 and 2524–2526), and the file was removed both times. No dump happened in between.

Regression run

No xcl-smoke blocks: I have no Windows machine to run scripts/smoke.ps1 on. The change does nothing unless XCL_DUMP_ON is set.

main:

not run

PR:

not run

Not tested

  • Windows.
  • NVIDIA.
  • The full workspace test suite.

AI use

  • Claude Code (Claude Opus 5.5) wrote the change, the test and this description at my request; I reviewed it and used the trigger in my runs.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5554599402 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3458). Originally posted by [lucsoft](https://github.com/lucsoft) on 2026-11-29T20:06:24Z. --- `XCL_DUMP_TARGETS` dumps the first busy frames, or the first ones after `XCL_DUMP_AFTER_S` seconds. Whether a given second lands on the scene you want to look at depends on load times and on how fast you get there. In practice the dump usually misses it, and every miss costs a restart. `XCL_DUMP_ON=<file>` lets the dump wait for a file instead: `touch` it at the scene, and the next frames are dumped. You can ask again later in the same run. **What is in it** - `crates/xcl/src/hle/d3d12x/targets.rs`: `XCL_DUMP_ON=<file>`. - Every 15th present checks for the file. When the file is there and can be removed, the next `frames` frames with at least `work` draws and dispatches are dumped. Both values come from `XCL_DUMP_TARGETS`, which stays required. - After that, the trigger waits for the file again. - Removing the file is what makes each `touch` ask for exactly one dump. - `XCL_DUMP_AFTER_S` is not used when `XCL_DUMP_ON` is set. - The path is the title process's own: under Wine, `Z:\tmp\dump` for `/tmp/dump`. - A log line when the file is found. - A unit test, `a_file_asks_for_one_dump_and_is_looked_for_every_fifteenth_present`. It covers the check cadence, that the file is removed, that one file asks once, and that the file trigger does not use `XCL_DUMP_AFTER_S`. - The module docs and the `XCL_DUMP_TARGETS` paragraph in `README.md`. Without `XCL_DUMP_ON`, nothing changes. **Tested** - Linux: NixOS, kernel 7.3.5, RX 7800 XT (RADV, Mesa 26.3.1), Ryzen 7 7800X3D, Rust 1.95.0 (nixpkgs), release, cross build to `x86_64-pc-windows-gnu`. - `cargo build --release -p xcl` and `cargo test --release -p xcl --no-run` succeed on this head. - The `targets` unit tests, run under Wine 11.21 (`xcl-….exe targets::`): 11 passed, 0 failed, 0 ignored, including the new one. The full workspace suite was not run. - Retail title under Wine with this change on a local stack (the same code, before this cleanup): `XCL_DUMP_ON=Z:\tmp\xclq\dump-now XCL_DUMP_TARGETS=2000,3,24`, two `touch`es in one run, about 150 frames apart. Each `touch` dumped 3 frames with 24 targets each (frames 2370–2373 and 2524–2526), and the file was removed both times. No dump happened in between. **Regression run** No `xcl-smoke` blocks: I have no Windows machine to run `scripts/smoke.ps1` on. The change does nothing unless `XCL_DUMP_ON` is set. main: not run PR: not run **Not tested** - Windows. - NVIDIA. - The full workspace test suite. **AI use** - Claude Code (Claude Opus 5.5) wrote the change, the test and this description at my request; I reviewed it and used the trigger in my runs. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!3458
No description provided.