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

Merged
gefydev merged 2 commits from upstream-pr/2313 into main 2026-11-25 21:36:25 +00:00
gefydev commented 2026-11-25 13:32:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-25T13:32:57Z.


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.
<!-- greyfinch-sync:ivall/xcl:issue:6605653678 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2313). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-25T13:32:57Z. --- 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.
oni-swr commented 2026-11-25 14:10:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-25T13:46:06Z.


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.
<!-- greyfinch-sync:ivall/xcl:comment:7164260499 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2313#issuecomment-7164260499). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-25T13:46:06Z. --- **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.
gefydev commented 2026-11-25 14:10:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-25T13:48:09Z.


@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.

<!-- greyfinch-sync:ivall/xcl:comment:7164310889 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2313#issuecomment-7164310889). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-25T13:48:09Z. --- @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.
DavidM1911 commented 2026-11-25 18:04:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T17:41:20Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7169858992 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2313#issuecomment-7169858992). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T17:41:20Z. --- 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!
gefydev commented 2026-11-25 18:04:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-25T17:49:30Z.


@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.

<!-- greyfinch-sync:ivall/xcl:comment:7170051207 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2313#issuecomment-7170051207). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-25T17:49:30Z. --- @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.
upstream-sync closed this pull request 2026-11-25 22:05:53 +00:00
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!2303
No description provided.