README: the switches for a bug report's diagnostics #2313

Manually merged
github merged 2 commits from gh-pr/2313/head into gh-pr/2313/base 2026-11-26 05:26:58 +00:00
Owner

@⁠gefydev on GitHub · 2026-11-25 13:32 UTC · original
gefydev:readme-diagnostics-switches → main · +25 −0 · 1 files · 2 commits · merged 2026-11-25 21:36 UTC

Seven switches that bug reports and issue threads use to see what a title is doing are read by the runtime and are not in the README. Docs only. Part of the "document what a user sets" gap; the xcl.toml keys are #2190's and are not touched here.

What is in it

  • README.md: a "Diagnostics for a bug report" entry in the "Switches, caches, logs and the files XCL writes" block, with XCL_RUN_SECONDS, XCL_ACTIVITY, XCL_THREAD_DUMP_AT, XCL_TRACE_FAULTS, XCL_TRACE_MEM, XCL_TRACE_IMPORTS and XCL_D3D12_TRACE. Each line gives what lands in xcl.log and the values the code accepts, read from host.rs, eh.rs, hle/kernelx.rs, resolver.rs and hle/d3d12x/real.rs.

Tested

  • Docs only: no code changed. Every statement was checked against the code that reads the variable (the files above), including the accepted values and the limits (the first 32 access violations, the first 60 allocations of 64 KiB or more).
  • Searched the README and docs/ for each name first: none of the seven was there.

Not tested

  • The switches were read from the code, not run for this PR; cargo test and scripts/smoke.ps1 were not run, since no code changed.
  • Other open README PRs (#741, #2218, #2190) touch nearby lines, so this one may need a rebase; the entry is a separate block, not an edit of theirs.

AI use

  • Claude Code, Claude Sonnet 5.5: read the code, wrote the entries and this description.
**@⁠gefydev** on GitHub · 2026-11-25 13:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/2313) `gefydev:readme-diagnostics-switches` → `main` · +25 −0 · 1 files · 2 commits · merged 2026-11-25 21:36 UTC Seven switches that bug reports and issue threads use to see what a title is doing are read by the runtime and are not in the README. Docs only. Part of the "document what a user sets" gap; the xcl.toml keys are #2190's and are not touched here. **What is in it** - `README.md`: a "Diagnostics for a bug report" entry in the "Switches, caches, logs and the files XCL writes" block, with `XCL_RUN_SECONDS`, `XCL_ACTIVITY`, `XCL_THREAD_DUMP_AT`, `XCL_TRACE_FAULTS`, `XCL_TRACE_MEM`, `XCL_TRACE_IMPORTS` and `XCL_D3D12_TRACE`. Each line gives what lands in `xcl.log` and the values the code accepts, read from `host.rs`, `eh.rs`, `hle/kernelx.rs`, `resolver.rs` and `hle/d3d12x/real.rs`. **Tested** - Docs only: no code changed. Every statement was checked against the code that reads the variable (the files above), including the accepted values and the limits (the first 32 access violations, the first 60 allocations of 64 KiB or more). - Searched the README and `docs/` for each name first: none of the seven was there. **Not tested** - The switches were read from the code, not run for this PR; `cargo test` and `scripts/smoke.ps1` were not run, since no code changed. - Other open README PRs (#741, #2218, #2190) touch nearby lines, so this one may need a rebase; the entry is a separate block, not an edit of theirs. **AI use** - Claude Code, Claude Sonnet 5.5: read the code, wrote the entries and this description.
XCL_RUN_SECONDS, XCL_ACTIVITY, XCL_THREAD_DUMP_AT, XCL_TRACE_FAULTS, XCL_TRACE_MEM,
XCL_TRACE_IMPORTS and XCL_D3D12_TRACE are read by the runtime and used in bug
reports and in the issue threads, and none of them was in the README. Each entry
says what lands in xcl.log and what the accepted values are, as read from the code.
The review of #2313 found two inexact lines. The import trace compares a word with the
lower-cased "<dll file name>!<Function>", extension included, so the example's
`-kernelx!GetTickCount` excluded nothing and is now `-kernelx.dll!GetTickCount`. And
XCL_TRACE_MEM is read with var_os in gpu/uma.rs as well, where any value also logs XCL's own
allocations of 1 MB or more in the committed window and the ones that fail.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:26:56 +00:00
github manually merged commit dbd11b92f5 into gh-pr/2313/base 2026-11-26 05:26:58 +00:00
Author
Owner

@⁠oni-swr on GitHub · 2026-11-25 13:46 UTC · original

Docs review of #2313 at head 7817eb17eba0ce921d78e60b862c2ebe49a71185, against origin/main afc5ee86ae3a9521c9f15d96505cd73fe72f2191 (PR based on 1a0bbe3; merges into current main cleanly; README.md on main has none of these variables yet).

Checked against the source (all match unless noted): XCL_RUN_SECONDS (host.rs: whole-number u64, anything else ignored), XCL_ACTIVITY (any value, even 0, turns it on; 2 s activity (2 s) line plus memory: line), XCL_THREAD_DUMP_AT (comma list of seconds), XCL_TRACE_FAULTS (any value; first 32 access violations; read/write/execute, address, rax/rcx/rdx/r8, stack callers; logged from the exception handler), XCL_TRACE_MEM (1 or unset-like values trace the first 60 allocations of 64 KiB or more, n > 1 the first n), XCL_D3D12_TRACE (any value, logs interface and method), XCL_TRACE_IMPORTS word semantics (1/hle, all, prefix include, - exclude; a list with no include word means hle).

One inaccuracy

  • XCL_TRACE_IMPORTS example hle,-kernelx!GetTickCount: the filter compares each word as a prefix of the lower-cased <dll key>!<Function>, and dll_key keeps the extension (kernelx.dll!gettickcount). -kernelx!GetTickCount is therefore not a prefix of anything and excludes nothing; -kernelx.dll!GetTickCount would. (gameinput works because it is a prefix of gameinput.dll!….) The same example is in the source comment in resolver.rs and in HANDOFF.md, so it is not this PR's invention, but the README should say dll.dll!Function or use kernelx.dll! in the example. I read this from resolver.rs and util::dll_key; I did not run it.

Minor

  • XCL_TRACE_MEM with any value (even 0) also turns on the UMA allocation trace in gpu/uma.rs, and XCL_TRACE_MEM=0 still logs 60 allocations. The README text is correct for 1 and n; you may want "any value turns it on" for consistency with the others.
  • XCL_RUN_SECONDS: "GPU drained" is what the code comment says the end path does (end_title); I did not run it.

Overlap

  • #2314 edits README.md in a different place (no conflict). #2144, #1832 and #2111 change what the XCL_ACTIVITY line contains (host.rs); the README text is generic enough to stay true, but check it if they land first. No other open PR documents these variables.

Not tested

  • Nothing was run: this is a docs-only diff checked by reading the source on origin/main. The full workspace suite, GPU tests and scripts/smoke.ps1 / any title run were not run either.

AI use

  • Review written by Claude Code (Claude Sonnet 5.5). I read the full diff and the code each statement refers to; nothing was changed or pushed.
**@⁠oni-swr** on GitHub · 2026-11-25 13:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/2313#issuecomment-7164260499) **Docs review of #2313** at head `7817eb17eba0ce921d78e60b862c2ebe49a71185`, against `origin/main` `afc5ee86ae3a9521c9f15d96505cd73fe72f2191` (PR based on `1a0bbe3`; merges into current `main` cleanly; `README.md` on `main` has none of these variables yet). **Checked against the source** (all match unless noted): `XCL_RUN_SECONDS` (`host.rs`: whole-number `u64`, anything else ignored), `XCL_ACTIVITY` (any value, even `0`, turns it on; 2 s `activity (2 s)` line plus `memory:` line), `XCL_THREAD_DUMP_AT` (comma list of seconds), `XCL_TRACE_FAULTS` (any value; first 32 access violations; read/write/execute, address, rax/rcx/rdx/r8, stack callers; logged from the exception handler), `XCL_TRACE_MEM` (`1` or unset-like values trace the first 60 allocations of 64 KiB or more, `n > 1` the first n), `XCL_D3D12_TRACE` (any value, logs interface and method), `XCL_TRACE_IMPORTS` word semantics (`1`/`hle`, `all`, prefix include, `-` exclude; a list with no include word means `hle`). **One inaccuracy** - `XCL_TRACE_IMPORTS` example `hle,-kernelx!GetTickCount`: the filter compares each word as a prefix of the lower-cased `<dll key>!<Function>`, and `dll_key` keeps the extension (`kernelx.dll!gettickcount`). `-kernelx!GetTickCount` is therefore not a prefix of anything and excludes nothing; `-kernelx.dll!GetTickCount` would. (`gameinput` works because it is a prefix of `gameinput.dll!…`.) The same example is in the source comment in `resolver.rs` and in `HANDOFF.md`, so it is not this PR's invention, but the README should say `dll.dll!Function` or use `kernelx.dll!` in the example. I read this from `resolver.rs` and `util::dll_key`; I did not run it. **Minor** - `XCL_TRACE_MEM` with any value (even `0`) also turns on the UMA allocation trace in `gpu/uma.rs`, and `XCL_TRACE_MEM=0` still logs 60 allocations. The README text is correct for `1` and `n`; you may want "any value turns it on" for consistency with the others. - `XCL_RUN_SECONDS`: "GPU drained" is what the code comment says the end path does (`end_title`); I did not run it. **Overlap** - #2314 edits `README.md` in a different place (no conflict). #2144, #1832 and #2111 change what the `XCL_ACTIVITY` line contains (`host.rs`); the README text is generic enough to stay true, but check it if they land first. No other open PR documents these variables. **Not tested** - Nothing was run: this is a docs-only diff checked by reading the source on `origin/main`. The full workspace suite, GPU tests and `scripts/smoke.ps1` / any title run were not run either. **AI use** - Review written by Claude Code (Claude Sonnet 5.5). I read the full diff and the code each statement refers to; nothing was changed or pushed.
Author
Owner

@⁠gefydev on GitHub · 2026-11-25 13:48 UTC · original

@⁠oni-swr thank you for the review of #2313; both points are right, and fixed in dbd11b9.

  • XCL_TRACE_IMPORTS: wants compares a word with the lower-cased <dll key>!<Function>, and the key keeps the extension (resolver.rs), so -kernelx!GetTickCount excluded nothing. The example is now hle,-kernelx.dll!GetTickCount,gameinput, and the text says the name carries the DLL's extension and that case does not matter.
  • XCL_TRACE_MEM: gpu/uma.rs reads it with var_os too, so any value turns it on, and there it also logs XCL's own allocations of 1 MB or more in the committed window and the ones that fail. The entry says both.
    The other lines were not changed. Noted on #2144, #1832 and #2111 changing the XCL_ACTIVITY line: I will check the README text if one of them lands first.

AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @⁠gefydev.

**@⁠gefydev** on GitHub · 2026-11-25 13:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/2313#issuecomment-7164310889) @⁠oni-swr thank you for the review of #2313; both points are right, and fixed in `dbd11b9`. - `XCL_TRACE_IMPORTS`: `wants` compares a word with the lower-cased `<dll key>!<Function>`, and the key keeps the extension (`resolver.rs`), so `-kernelx!GetTickCount` excluded nothing. The example is now `hle,-kernelx.dll!GetTickCount,gameinput`, and the text says the name carries the DLL's extension and that case does not matter. - `XCL_TRACE_MEM`: `gpu/uma.rs` reads it with `var_os` too, so any value turns it on, and there it also logs XCL's own allocations of 1 MB or more in the committed window and the ones that fail. The entry says both. The other lines were not changed. Noted on #2144, #1832 and #2111 changing the `XCL_ACTIVITY` line: I will check the README text if one of them lands first. AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @⁠gefydev.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 17:41 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 17:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/2313#issuecomment-7169858992) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠gefydev on GitHub · 2026-11-25 17:49 UTC · original

@⁠DavidM1911 thank you for the verifications on #2310, #2311, #2312 (all three already merged) and #2313, the same on each: RTX 3060 Ti, Windows 11, branch merged with current main, cargo test -p xcl --lib all passed, 0 failed, about 26 ignored, with the intermittent abort under parallel scheduling tracked in #1978 that was clean on a single-threaded rerun. Noted.

AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @⁠gefydev.

**@⁠gefydev** on GitHub · 2026-11-25 17:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/2313#issuecomment-7170051207) @⁠DavidM1911 thank you for the verifications on #2310, #2311, #2312 (all three already merged) and #2313, the same on each: RTX 3060 Ti, Windows 11, branch merged with current `main`, `cargo test -p xcl --lib` all passed, 0 failed, about 26 ignored, with the intermittent abort under parallel scheduling tracked in #1978 that was clean on a single-threaded rerun. Noted. AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @⁠gefydev.
This discussion has been locked. Commenting is limited to contributors.
No description provided.