TLS: installing an image leaves other threads' blocks to the loader #431

Open
github-bot wants to merge 1 commit from github-bot/gh-431 into main AGit
Owner

@⁠Kalmarv on GitHub · 2026-11-24 00:11 UTC · original
Kalmarv:fix/tls-fill-live-threads → main · +88 −69 · 1 files · 1 commits · open

cargo test -p xcl --lib sometimes dies with 0xC0000005 before any test fails (only with several test threads). The crash is in tls::install. After loading the carrier DLL, it filled every other thread's new TLS slot itself: a toolhelp snapshot, then each thread's TEB read and its TLS block written. A thread that exits in between has its TEB unmapped, which is the read AV, or its TLS block freed by LdrShutdownThread, which means heap corruption. Nothing outside the loader can hold a thread's TEB or TLS in place, so the walk can't be made safe:

  • a handle keeps only the thread object;
  • STILL_ACTIVE holds while the blocks are freed;
  • suspending doesn't stop a thread already exiting in the kernel.

The carrier now carries the image's template, so the loader fills every thread's block itself, under its own lock.

What is in it

  • build_carrier_dll_holding: the carrier's TLS initial data is the image's template, with zeros after it. install uses it.
  • fill_existing_threads is removed, and the module docs say who fills the blocks now.
  • Nothing else changes: on_thread_attach still fills new threads (now with the same bytes), and take_slot_zero is untouched.
  • Tests:
    • carrier_holds_the_template;
    • a_thread_running_during_install_gets_the_template: a thread started before install finds the template in its own block, and nothing in XCL writes into it;
    • install_while_threads_exit: 200 installs while 8 threads keep starting and ending short threads. Its carriers go to one folder, %TEMP%\xcl_tls_test_churn, cleared of earlier runs' carriers at the start (cleanup_cache).
  • Overlaps #196 (same file). #196 keeps the walk, and its stress test keeps its workers alive "so no thread exits and unmaps its TEB while fill_existing_threads() walks process threads". A local merge with #196 at 49d28fc conflicts in three places, where #196's aligned template offset meets the template copy. Resolved that way, all 11 tls tests pass, including #196's alignment-on-all-threads test. I can rebase either way.

Tested

  • RTX 5070 Ti, NVIDIA 610.74, Windows 11 Pro 26200; MSVC stable, debug.
  • cargo test --workspace -- --test-threads=4 on 940f7cb (this PR, on main 9ce2070): 687 passed, 0 failed, 41 ignored (the xcl library: 647 passed, 21 ignored). SKIPPED GPU tests: 2, both no wave64 (gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware).
  • The crash, named. On main 6da33fa, cargo test -p xcl --lib (default threads) ran under a debugger that passes first-chance exceptions on and catches the second-chance one with its thread and stack. It crashed in run 2 of 2, on thread tls::tests::install_without_an_index_variable: a read of TEB+0x58 in tls_block_of ← fill_existing_threads ← install. With --test-threads=1 it passed 6 of 6.
  • The churn test (--exact, under the same debugger, CPU only):
    • main d4f17ca with the test added: 19 of 20 runs crashed, every one at the same read;
    • this change: 30 of 30 passed.
  • cargo test -p xcl --lib tls:: on 940f7cb, 3 runs: 7 passed, 1 ignored each. After each run, %TEMP%\xcl_tls_test_churn held 200 carriers, all from that run.
  • With the mutation (the carrier without the template, and no walk), three tests fail: install_without_an_index_variable, windows_loads_carrier_and_allocates_full_block_for_all_threads and a_thread_running_during_install_gets_the_template.
  • cargo test -p xcl --lib, 10 runs each, interleaved, main d4f17ca and this change:
    • neither side hit the TLS crash: it's too rare in the suite to show in 10 runs;
    • each side had 2 crashes from a different, unrelated race: a write to the same GPU-visible address in two kernelx tests (xmem_placeholder_split_replace_and_coalesce, console_alloc_flags_are_stripped).
    • The other runs: main 605 passed, 21 ignored; this change 608 passed, 20 ignored (it adds three tests).
  • Wine 11.21 Staging, windows-gnu, CPU only (run by a second agent on Ubuntu): tls:: and pe:: pass. The two new thread tests pass 10 of 10, so Wine's loader also fills running threads from the carrier's template. Main with the churn test also passes 10 of 10 there, so the race doesn't reproduce under Wine.
  • Independent run by @⁠MesshM (https://github.com/ivall/xcl/pull/431#issuecomment-7118649688): AMD Radeon RX 9060 XT (RDNA4, driver 32.0.32029.2010), Ryzen 7 5700X (16 threads), Windows 11 26200, Rust 1.100.0, debug, 526a176 merged onto main a6f5f7a. scripts/test.ps1: 679 passed, 0 failed, 41 ignored, no SKIPPED GPU tests. install_while_threads_exit on main: 3 of 3 crashed (access violation); with this change 3 of 3 passed.
  • Regression run on a retail title by @⁠srcamarda (https://github.com/ivall/xcl/pull/431#issuecomment-7119961537): AMD Radeon RX 7800 XT (RDNA3, driver 32.0.32029.2010), Ryzen 5 5600G, Windows 11 Pro 26300, release builds, scripts/smoke.ps1 -Seconds 90, main 508a0c7 against da285ce (this PR before the rebase onto 9ce2070), each run twice and the second run kept: 2361 and 2359 frames, peak commit 15674 and 16414 MB, no device removal or crash in any run. Their PR block names gpu: SudoMaker Virtual Display Adapter: da285ce has smoke.ps1 from before 97dc49c, which reads the adapter from report.json; XCL ran on the RX 7800 XT. They put the higher peak commit down to the old base, which the rebase replaces. Their main log shows install for three images with other threads alive (TLS: <executable>: … threads initialized: 3, the line main's install writes).

Regression run

Our own runs, one after the other on the machine under Tested (RTX 5070 Ti), release builds, no uncommitted changes.

main:

xcl-smoke v1
commit: 9ce2070eccf436d7bd38601c90407da447df34f3
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1588 (PresentX 1588)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14423 MB

PR:

xcl-smoke v1
commit: 940f7cb7341c80a4bf493163962d1c0c2a0ee506
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1562 (PresentX 1562)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14557 MB

Not tested

  • Whether the smoke runs above reach the loader's own call (loader::tls_install) with a real image's TLS: not checked. The only test that reaches it needs real console DLLs.
  • take_slot_zero walks the threads' TEBs the same way, once, for a title's executable. It isn't changed here.
  • macOS / Linux: not built.

AI use

  • Claude Code, Claude Opus 5.5: found the crash (debugger capture of the suite), wrote the change, the tests and this description; the runs above are its own, except the Wine run, which another of our agents made on Ubuntu.

🤖 Generated with Claude Code

**@⁠Kalmarv** on GitHub · 2026-11-24 00:11 UTC · [original](https://github.com/xcl-dev/xcl/pull/431) `Kalmarv:fix/tls-fill-live-threads` → `main` · +88 −69 · 1 files · 1 commits · open `cargo test -p xcl --lib` sometimes dies with `0xC0000005` before any test fails (only with several test threads). The crash is in `tls::install`. After loading the carrier DLL, it filled every other thread's new TLS slot itself: a toolhelp snapshot, then each thread's TEB read and its TLS block written. A thread that exits in between has its TEB unmapped, which is the read AV, or its TLS block freed by `LdrShutdownThread`, which means heap corruption. Nothing outside the loader can hold a thread's TEB or TLS in place, so the walk can't be made safe: - a handle keeps only the thread object; - `STILL_ACTIVE` holds while the blocks are freed; - suspending doesn't stop a thread already exiting in the kernel. The carrier now carries the image's template, so the loader fills every thread's block itself, under its own lock. **What is in it** - `build_carrier_dll_holding`: the carrier's TLS initial data is the image's template, with zeros after it. `install` uses it. - `fill_existing_threads` is removed, and the module docs say who fills the blocks now. - Nothing else changes: `on_thread_attach` still fills new threads (now with the same bytes), and `take_slot_zero` is untouched. - Tests: - `carrier_holds_the_template`; - `a_thread_running_during_install_gets_the_template`: a thread started before `install` finds the template in its own block, and nothing in XCL writes into it; - `install_while_threads_exit`: 200 installs while 8 threads keep starting and ending short threads. Its carriers go to one folder, `%TEMP%\xcl_tls_test_churn`, cleared of earlier runs' carriers at the start (`cleanup_cache`). - Overlaps #196 (same file). #196 keeps the walk, and its stress test keeps its workers alive "so no thread exits and unmaps its TEB while fill_existing_threads() walks process threads". A local merge with #196 at `49d28fc` conflicts in three places, where #196's aligned template offset meets the template copy. Resolved that way, all 11 tls tests pass, including #196's alignment-on-all-threads test. I can rebase either way. **Tested** - RTX 5070 Ti, NVIDIA 610.74, Windows 11 Pro 26200; MSVC stable, debug. - `cargo test --workspace -- --test-threads=4` on `940f7cb` (this PR, on main `9ce2070`): 687 passed, 0 failed, 41 ignored (the `xcl` library: 647 passed, 21 ignored). SKIPPED GPU tests: 2, both `no wave64` (`gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`). - **The crash, named.** On main `6da33fa`, `cargo test -p xcl --lib` (default threads) ran under a debugger that passes first-chance exceptions on and catches the second-chance one with its thread and stack. It crashed in run 2 of 2, on thread `tls::tests::install_without_an_index_variable`: a read of `TEB+0x58` in `tls_block_of` ← `fill_existing_threads` ← `install`. With `--test-threads=1` it passed 6 of 6. - **The churn test** (`--exact`, under the same debugger, CPU only): - main `d4f17ca` with the test added: 19 of 20 runs crashed, every one at the same read; - this change: 30 of 30 passed. - `cargo test -p xcl --lib tls::` on `940f7cb`, 3 runs: 7 passed, 1 ignored each. After each run, `%TEMP%\xcl_tls_test_churn` held 200 carriers, all from that run. - **With the mutation** (the carrier without the template, and no walk), three tests fail: `install_without_an_index_variable`, `windows_loads_carrier_and_allocates_full_block_for_all_threads` and `a_thread_running_during_install_gets_the_template`. - **`cargo test -p xcl --lib`, 10 runs each, interleaved**, main `d4f17ca` and this change: - neither side hit the TLS crash: it's too rare in the suite to show in 10 runs; - each side had 2 crashes from a different, unrelated race: a write to the same GPU-visible address in two kernelx tests (`xmem_placeholder_split_replace_and_coalesce`, `console_alloc_flags_are_stripped`). - The other runs: main 605 passed, 21 ignored; this change 608 passed, 20 ignored (it adds three tests). - **Wine** 11.21 Staging, windows-gnu, CPU only (run by a second agent on Ubuntu): `tls::` and `pe::` pass. The two new thread tests pass 10 of 10, so Wine's loader also fills running threads from the carrier's template. Main with the churn test also passes 10 of 10 there, so the race doesn't reproduce under Wine. - Independent run by @⁠MesshM (https://github.com/ivall/xcl/pull/431#issuecomment-7118649688): AMD Radeon RX 9060 XT (RDNA4, driver 32.0.32029.2010), Ryzen 7 5700X (16 threads), Windows 11 26200, Rust 1.100.0, debug, `526a176` merged onto `main` `a6f5f7a`. `scripts/test.ps1`: 679 passed, 0 failed, 41 ignored, no SKIPPED GPU tests. `install_while_threads_exit` on `main`: 3 of 3 crashed (access violation); with this change 3 of 3 passed. - Regression run on a retail title by @⁠srcamarda (https://github.com/ivall/xcl/pull/431#issuecomment-7119961537): AMD Radeon RX 7800 XT (RDNA3, driver 32.0.32029.2010), Ryzen 5 5600G, Windows 11 Pro 26300, release builds, `scripts/smoke.ps1 -Seconds 90`, `main` `508a0c7` against `da285ce` (this PR before the rebase onto `9ce2070`), each run twice and the second run kept: 2361 and 2359 frames, peak commit 15674 and 16414 MB, no device removal or crash in any run. Their PR block names `gpu: SudoMaker Virtual Display Adapter`: `da285ce` has `smoke.ps1` from before 97dc49c, which reads the adapter from `report.json`; XCL ran on the RX 7800 XT. They put the higher peak commit down to the old base, which the rebase replaces. Their `main` log shows `install` for three images with other threads alive (`TLS: <executable>: … threads initialized: 3`, the line `main`'s `install` writes). **Regression run** Our own runs, one after the other on the machine under **Tested** (RTX 5070 Ti), release builds, no uncommitted changes. main: ``` xcl-smoke v1 commit: 9ce2070eccf436d7bd38601c90407da447df34f3 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1588 (PresentX 1588) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14423 MB ``` PR: ``` xcl-smoke v1 commit: 940f7cb7341c80a4bf493163962d1c0c2a0ee506 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1562 (PresentX 1562) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14557 MB ``` **Not tested** - Whether the smoke runs above reach the loader's own call (`loader::tls_install`) with a real image's TLS: not checked. The only test that reaches it needs real console DLLs. - `take_slot_zero` walks the threads' TEBs the same way, once, for a title's executable. It isn't changed here. - macOS / Linux: not built. **AI use** - Claude Code, Claude Opus 5.5: found the crash (debugger capture of the suite), wrote the change, the tests and this description; the runs above are its own, except the Wine run, which another of our agents made on Ubuntu. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tls::install filled the new slot of every other thread itself: a
toolhelp snapshot, then each thread's TEB and TLS block read and
written. A thread that exited in between had its TEB or block freed
under the access: the access violation that ends cargo test -p xcl --lib
now and then (tls_block_of <- fill_existing_threads <- install, from
install_without_an_index_variable).

The carrier DLL now holds the image's template, so the loader starts
every thread's block as it - the threads running at LoadLibrary under
its own lock, later ones as they start - and the walk goes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:21:36 +00:00
Author
Owner

@⁠MesshM on GitHub · 2026-11-24 00:59 UTC · original

Test run of 526a17661f22431342f4a89c4f8925eb68fedd18 on AMD (RDNA4); the PR was tested on NVIDIA only. The branch is based on 9ab7d76, so I merged it onto current main a6f5f7a locally (clean merge, only tls.rs) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X (8C/16T), 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4) on the merge: 679 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 639 passed, 0 failed, 21 ignored (main on this machine: 636 / 676, the difference is the 3 new tests)
  • 0 SKIPPED; all tls::tests pass, including a_thread_running_during_install_gets_the_template and install_while_threads_exit
  • install_while_threads_exit copied unchanged into main's tls.rs (nothing else changed), cargo test -p xcl --lib tls::tests::install_while_threads_exit, 3 runs: 3 of 3 crashed with 0xc0000005, STATUS_ACCESS_VIOLATION
  • the same test on the merge, 3 runs: 3 of 3 passed (1.95–2.04 s)

So on this 16-thread machine the race reproduces every time, not 1 run in 3.

Review of the change: install runs in step 5 of loader::map, after relocations (step 3), so the template the carrier now carries is the relocated one, the same bytes fill_block used to copy; past template_len the block is zeros, as before. on_thread_attach still fills new threads from the image's live template, so that path is unchanged. I found nothing to change.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main; the overlap with #196 was not checked.

Run and report by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

**@⁠MesshM** on GitHub · 2026-11-24 00:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/431#issuecomment-7118649688) Test run of `526a17661f22431342f4a89c4f8925eb68fedd18` on AMD (RDNA4); the PR was tested on NVIDIA only. The branch is based on `9ab7d76`, so I merged it onto current `main` `a6f5f7a` locally (clean merge, only `tls.rs`) and tested that tree. **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X (8C/16T), 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`) on the merge: **679 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 639 passed, 0 failed, 21 ignored (`main` on this machine: 636 / 676, the difference is the 3 new tests) - **0 `SKIPPED`**; all `tls::tests` pass, including `a_thread_running_during_install_gets_the_template` and `install_while_threads_exit` - `install_while_threads_exit` copied unchanged into `main`'s `tls.rs` (nothing else changed), `cargo test -p xcl --lib tls::tests::install_while_threads_exit`, 3 runs: **3 of 3 crashed** with `0xc0000005, STATUS_ACCESS_VIOLATION` - the same test on the merge, 3 runs: 3 of 3 passed (1.95–2.04 s) So on this 16-thread machine the race reproduces every time, not 1 run in 3. **Review of the change:** `install` runs in step 5 of `loader::map`, after relocations (step 3), so the template the carrier now carries is the relocated one, the same bytes `fill_block` used to copy; past `template_len` the block is zeros, as before. `on_thread_attach` still fills new threads from the image's live template, so that path is unchanged. I found nothing to change. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`; the overlap with #196 was not checked. Run and report by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-24 01:18 UTC · original

NVIDIA run (only an AMD run so far) plus a short review.

Tested 526a17661 merged onto main a6f5f7a74 on Windows 11 Home 26200, RTX 4070 SUPER (driver 621.24, wave32), Rust 1.98, DXC 1.8.2502.11: pass.

  • cargo test --workspace -- --test-threads=4: 679 passed, 0 failed, 41 ignored (main: 676 / 0 / 41). SKIPPED: only the 2 no wave64 tests.
  • carrier_holds_the_template, a_thread_running_during_install_gets_the_template and install_while_threads_exit ran and passed; no TLS crash.
  • Not run: smoke.ps1 (no retail title on this machine), Wine.

Review – letting the loader seed every block from the carrier's template looks right; the template bytes sit outside the carrier's four DIR64 relocations (tls.rs:163-165), and the template_len == 0 branch avoids from_raw_parts(null).

  1. tls.rs:11-15 (module docs) still say existing threads are filled "right after the carrier is loaded (via their TEB)". The loader now does that from the template; could the paragraph be updated?
  2. Minor, tls.rs:601-614: each run writes 200 carrier DLLs to %TEMP%\xcl_tls_test_churn_<pid>\ and loads them into the shared --lib process, so they can't be deleted and pile up across runs. Fewer installs, or a fixed directory cleared at the start, would avoid that.

AI-assisted review (Claude Code, Claude Opus 5.5).
Discord: bigpeppa.

**@⁠QemmHD** on GitHub · 2026-11-24 01:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/431#issuecomment-7118966784) NVIDIA run (only an AMD run so far) plus a short review. **Tested** `526a17661` merged onto main `a6f5f7a74` on Windows 11 Home 26200, RTX 4070 SUPER (driver 621.24, wave32), Rust 1.98, DXC 1.8.2502.11: **pass**. - `cargo test --workspace -- --test-threads=4`: 679 passed, 0 failed, 41 ignored (main: 676 / 0 / 41). SKIPPED: only the 2 `no wave64` tests. - `carrier_holds_the_template`, `a_thread_running_during_install_gets_the_template` and `install_while_threads_exit` ran and passed; no TLS crash. - Not run: smoke.ps1 (no retail title on this machine), Wine. **Review** – letting the loader seed every block from the carrier's template looks right; the template bytes sit outside the carrier's four DIR64 relocations (`tls.rs:163-165`), and the `template_len == 0` branch avoids `from_raw_parts(null)`. 1. `tls.rs:11-15` (module docs) still say existing threads are filled "right after the carrier is loaded (via their TEB)". The loader now does that from the template; could the paragraph be updated? 2. Minor, `tls.rs:601-614`: each run writes 200 carrier DLLs to `%TEMP%\xcl_tls_test_churn_<pid>\` and loads them into the shared `--lib` process, so they can't be deleted and pile up across runs. Fewer installs, or a fixed directory cleared at the start, would avoid that. AI-assisted review (Claude Code, Claude Opus 5.5). Discord: bigpeppa.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-24 02:02 UTC · original

Thanks, @⁠QemmHD. Both points were right, and both are fixed in da285ce (squashed into the PR's commit).

  1. The module docs (tls.rs:7-16) now say what the code does: the carrier's template is the game's, and ntdll starts every thread's block from it, both the threads running when the carrier loads and later ones. on_thread_attach copies it again for new threads.
  2. install_while_threads_exit now uses one folder, %TEMP%\xcl_tls_test_churn. It clears earlier runs' carriers at the start with the existing cleanup_cache, and the file names keep the process id, so runs at the same time don't clash. After each of 3 runs here the folder held 200 files, all from that run.

🤖 Claude Opus 5.5

**@⁠Kalmarv** on GitHub · 2026-11-24 02:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/431#issuecomment-7119695522) Thanks, @⁠QemmHD. Both points were right, and both are fixed in `da285ce` (squashed into the PR's commit). 1. The module docs (`tls.rs:7-16`) now say what the code does: the carrier's template is the game's, and ntdll starts every thread's block from it, both the threads running when the carrier loads and later ones. `on_thread_attach` copies it again for new threads. 2. `install_while_threads_exit` now uses one folder, `%TEMP%\xcl_tls_test_churn`. It clears earlier runs' carriers at the start with the existing `cleanup_cache`, and the file names keep the process id, so runs at the same time don't clash. After each of 3 runs here the folder held 200 files, all from that run. 🤖 Claude Opus 5.5
Author
Owner

@⁠srcamarda on GitHub · 2026-11-24 02:16 UTC · original

Regression run on a retail title, as asked under Regression run.

Tested

  • AMD Radeon RX 7800 XT (RDNA3), driver 32.0.32029.2010; Ryzen 5 5600G, 32 GB; Windows 11 Pro 26300; release builds
  • scripts/smoke.ps1 -Seconds 90, no input (the title stays on its account screen at 30 fps). Each binary was built from a clean checkout of its commit and run twice; the first run of each has a cold translation cache. Blocks below are from the second run.
  • main 508a0c7: 2343 / 2361 frames, peak 15764 / 15674 MB. This PR (da285ce): 2322 / 2359 frames, peak 16486 / 16414 MB. No crash or device removal in any run.
  • The changed path runs in this title: its log shows a TLS install for three images with other threads alive, e.g. TLS: game_scarlett_master.exe: template 5248 B, block 5248 B, index 18, threads initialized: 3 (also xboxbvhbuilder.dll and libhttpclient.gdk.dll), and the title then runs normally.
  • This head is based on 9ab7d76, 60 commits behind main. Its peak commit is ~0.7 GB above main's here, most likely from the base: main's memory changes since then aren't in it. #443 and #470, both close to main, match main. A rebase would settle it.

Regression run

main:

xcl-smoke v1
commit: 508a0c74d7c0625d6d2de8d24494e69dc2e1926f
gpu: AMD Radeon RX 7800 XT
title: RetailGame_Dump
seconds: 90
exit: 0x0
frames shown: 2361 (PresentX 2361)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15674 MB

this PR's head:

xcl-smoke v1
commit: da285ce79cbfc485e2a284da694c0d6dd41801b5
gpu: SudoMaker Virtual Display Adapter
title: RetailGame_Dump
seconds: 90
exit: 0x0
frames shown: 2359 (PresentX 2360)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16414 MB

gpu: in this PR's block names a virtual display adapter: the head predates 97dc49c, which reads the adapter from report.json. XCL ran on the RX 7800 XT in every run.

Not tested

  • Anything past the account screen.
  • The whole test suite at this head (only the title runs).

AI use

  • Claude Code with Claude Opus 5.5 built both commits, ran the smoke runs and wrote this report; the runs are from my machine.
**@⁠srcamarda** on GitHub · 2026-11-24 02:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/431#issuecomment-7119961537) Regression run on a retail title, as asked under **Regression run**. **Tested** - AMD Radeon RX 7800 XT (RDNA3), driver 32.0.32029.2010; Ryzen 5 5600G, 32 GB; Windows 11 Pro 26300; release builds - `scripts/smoke.ps1 -Seconds 90`, no input (the title stays on its account screen at 30 fps). Each binary was built from a clean checkout of its commit and run twice; the first run of each has a cold translation cache. Blocks below are from the second run. - `main` `508a0c7`: 2343 / 2361 frames, peak 15764 / 15674 MB. This PR (`da285ce`): 2322 / 2359 frames, peak 16486 / 16414 MB. No crash or device removal in any run. - The changed path runs in this title: its log shows a TLS install for three images with other threads alive, e.g. `TLS: game_scarlett_master.exe: template 5248 B, block 5248 B, index 18, threads initialized: 3` (also `xboxbvhbuilder.dll` and `libhttpclient.gdk.dll`), and the title then runs normally. - This head is based on `9ab7d76`, 60 commits behind `main`. Its peak commit is ~0.7 GB above `main`'s here, most likely from the base: `main`'s memory changes since then aren't in it. #443 and #470, both close to `main`, match `main`. A rebase would settle it. **Regression run** `main`: ``` xcl-smoke v1 commit: 508a0c74d7c0625d6d2de8d24494e69dc2e1926f gpu: AMD Radeon RX 7800 XT title: RetailGame_Dump seconds: 90 exit: 0x0 frames shown: 2361 (PresentX 2361) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15674 MB ``` this PR's head: ``` xcl-smoke v1 commit: da285ce79cbfc485e2a284da694c0d6dd41801b5 gpu: SudoMaker Virtual Display Adapter title: RetailGame_Dump seconds: 90 exit: 0x0 frames shown: 2359 (PresentX 2360) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16414 MB ``` `gpu:` in this PR's block names a virtual display adapter: the head predates 97dc49c, which reads the adapter from `report.json`. XCL ran on the RX 7800 XT in every run. **Not tested** - Anything past the account screen. - The whole test suite at this head (only the title runs). **AI use** - Claude Code with Claude Opus 5.5 built both commits, ran the smoke runs and wrote this report; the runs are from my machine.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-24 10:40 UTC · original

Code/CI review only (not independently runtime-tested by me): clean merge with both checks green (Build and test + PR description). Cleanly fixes the intermittent tls::install crash by leaving other threads' TLS blocks to the loader. Recommend merging, @⁠ivall.

**@⁠raylitebull** on GitHub · 2026-11-24 10:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/431#issuecomment-7129095862) Code/CI review only (not independently runtime-tested by me): clean merge with both checks green (`Build and test` + `PR description`). Cleanly fixes the intermittent `tls::install` crash by leaving other threads' TLS blocks to the loader. Recommend merging, @⁠ivall.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 14:29 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 14:29 UTC · [original](https://github.com/xcl-dev/xcl/pull/431#issuecomment-7165348627) 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!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/431/head:github-bot/gh-431'
git switch 'github-bot/gh-431'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-431'
git switch 'github-bot/gh-431'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-431'
git switch 'github-bot/gh-431'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-431'
git switch 'main'
git merge --squash 'github-bot/gh-431'
git switch 'main'
git merge --ff-only 'github-bot/gh-431'
git switch 'main'
git merge 'github-bot/gh-431'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.