PE loader: thread callbacks wait for a DLL to be initialised #1110

Merged
emirduran707 merged 1 commit from upstream-pr/1119 into main 2026-11-30 02:50:52 +00:00
emirduran707 commented 2026-11-24 12:00:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-24T12:00:39Z.


loader::on_tls_event ran the TLS callbacks of every registered module on each DLL_THREAD_ATTACH / DETACH, and checked initialized only before calling DllMain. A game DLL is registered, and its TLS callbacks are read (map_image_ex step 5), before its pages get their protections (step 6) and before its PROCESS_ATTACH (init_dll).

So if the title LoadLibrarys a game DLL with TLS callbacks while another of its threads starts or ends, that DLL's callback can run:

  • on code that is not executable yet, which is a DEP fault (0xc0000005);
  • or before the DLL's runtime has set itself up for it.

Windows' loader sends thread notifications only to modules whose process attach has run.

What is in it

  • crates/xcl/src/loader.rs:
    • the module loop of on_tls_event is now thread_event;
    • it skips DLLs that are not initialised, for both the TLS callbacks and DllMain;
    • the executable, which never sets initialized, still gets its callbacks;
    • for initialised modules nothing changes (same order: callbacks then DllMain on attach, the reverse on detach).
  • Test thread_callbacks_wait_for_a_dll_to_be_initialised:
    • a DLL module that is registered but not initialised gets no callback on attach or detach;
    • once initialised it gets both, and an executable module gets them anyway;
    • without the change it fails with left: 5, right: 0 (both callbacks ran).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.31044.16; Ryzen 5 5600, 32 GB; Windows 11 Pro 26300; rustc 1.100.0 x86_64-pc-windows-msvc; DXC 1.9.2602.17; debug for the suite, release for the runs.
  • cargo test --workspace -- --test-threads=4 at df36761: 742 passed, 0 failed, 41 ignored; no SKIPPED lines.

Regression run

The gpu: line names a virtual display adapter of this machine (what #281 / #282 / #285 fix); XCL's log names backend 'real' – AMD Radeon RX 9060 XT (16188 MiB VRAM).

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: AMD Radeon RX 9060 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1574 (PresentX 1574)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16862 MB

PR:

xcl-smoke v1
commit: df3676101e0a3f03f5ae35575bdbffc39c40d1ce
gpu: AMD Radeon RX 9060 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1563 (PresentX 1563)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 19675 MB

Not tested

  • A title that loads a game DLL with TLS callbacks at run time while threads start: I have none that does. The race is reasoned from the code order above, and the unit test covers the check itself.
  • NVIDIA.

AI use

  • Claude Code with Claude Opus 5.5:
    • a sub-agent found this in an audit of the PE loader;
    • I checked the order in map_image_ex / init_dll / on_tls_event;
    • Claude Code wrote the change, the test and this description.
  • The runs above were made on my machine.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5471715742 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1119). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-24T12:00:39Z. --- `loader::on_tls_event` ran the TLS callbacks of every registered module on each `DLL_THREAD_ATTACH` / `DETACH`, and checked `initialized` only before calling DllMain. A game DLL is registered, and its TLS callbacks are read (`map_image_ex` step 5), before its pages get their protections (step 6) and before its PROCESS_ATTACH (`init_dll`). So if the title `LoadLibrary`s a game DLL with TLS callbacks while another of its threads starts or ends, that DLL's callback can run: - on code that is not executable yet, which is a DEP fault (`0xc0000005`); - or before the DLL's runtime has set itself up for it. Windows' loader sends thread notifications only to modules whose process attach has run. **What is in it** - `crates/xcl/src/loader.rs`: - the module loop of `on_tls_event` is now `thread_event`; - it skips DLLs that are not initialised, for both the TLS callbacks and DllMain; - the executable, which never sets `initialized`, still gets its callbacks; - for initialised modules nothing changes (same order: callbacks then DllMain on attach, the reverse on detach). - Test `thread_callbacks_wait_for_a_dll_to_be_initialised`: - a DLL module that is registered but not initialised gets no callback on attach or detach; - once initialised it gets both, and an executable module gets them anyway; - without the change it fails with `left: 5, right: 0` (both callbacks ran). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.31044.16; Ryzen 5 5600, 32 GB; Windows 11 Pro 26300; rustc 1.100.0 `x86_64-pc-windows-msvc`; DXC 1.9.2602.17; debug for the suite, release for the runs. - `cargo test --workspace -- --test-threads=4` at df36761: 742 passed, 0 failed, 41 ignored; no `SKIPPED` lines. **Regression run** The `gpu:` line names a virtual display adapter of this machine (what #281 / #282 / #285 fix); XCL's log names `backend 'real' – AMD Radeon RX 9060 XT (16188 MiB VRAM)`. main: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: AMD Radeon RX 9060 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 1574 (PresentX 1574) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16862 MB ``` PR: ``` xcl-smoke v1 commit: df3676101e0a3f03f5ae35575bdbffc39c40d1ce gpu: AMD Radeon RX 9060 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 1563 (PresentX 1563) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 19675 MB ``` **Not tested** - A title that loads a game DLL with TLS callbacks at run time while threads start: I have none that does. The race is reasoned from the code order above, and the unit test covers the check itself. - NVIDIA. **AI use** - Claude Code with Claude Opus 5.5: - a sub-agent found this in an audit of the PE loader; - I checked the order in `map_image_ex` / `init_dll` / `on_tls_event`; - Claude Code wrote the change, the test and this description. - The runs above were made on my machine. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
thehollowedone commented 2026-11-24 13:03:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-24T12:08:17Z.


Independent Windows 11 check at df36761 with Rust 1.99.1 MSVC. The offline workspace build and all three stock loader tests passed.

A scratch fixture using ordinary compiled callbacks verified both sides of initialization. While one DLL was still in process attach, it received no thread attach or detach callback. Already initialized modules kept their callback order. After initialization returned, the DLL joined the next thread notification in the expected position, with TLS before DllMain on attach and the reverse on detach. The executable kept its TLS notifications throughout. The fixture passed in three separate processes.

Synthetic coverage only. AI-assisted. Codex (GPT-6) added and ran the scratch fixture.

<!-- greyfinch-sync:ivall/xcl:comment:7131017511 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1119#issuecomment-7131017511). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-24T12:08:17Z. --- Independent Windows 11 check at [df36761](https://github.com/ivall/xcl/commit/df3676101e0a3f03f5ae35575bdbffc39c40d1ce) with Rust 1.99.1 MSVC. The offline workspace build and all three stock loader tests passed. A scratch fixture using ordinary compiled callbacks verified both sides of initialization. While one DLL was still in process attach, it received no thread attach or detach callback. Already initialized modules kept their callback order. After initialization returned, the DLL joined the next thread notification in the expected position, with TLS before DllMain on attach and the reverse on detach. The executable kept its TLS notifications throughout. The fixture passed in three separate processes. Synthetic coverage only. AI-assisted. Codex (GPT-6) added and ran the scratch fixture.
fromthemoonx commented 2026-11-24 13:03:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-24T12:39:44Z.


NVIDIA run with the whole suite, since Not tested lists NVIDIA; the earlier check here ran the loader tests and a fixture.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (32-lane waves), driver 32.0.16.1088; AMD Ryzen 7 5700X; native Windows 11 Pro 26H2 (build 26300.9974), Graphics Tools (D3D12 debug layer) installed; rustc 1.100.0 stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17; debug
  • Exact head df3676101e0a3f03f5ae35575bdbffc39c40d1ce, which is on current main 47efa2e (so also the merged result): cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored. The new loader::tests::thread_callbacks_wait_for_a_dll_to_be_initialised passed.
  • Fails with the old behaviour, as you say: the test calls the new thread_event, so I kept this PR's file and changed only ready back to "every module" (|_m| true, DllMain keeping its own initialized check, as before). The test fails with callbacks of a DLL not initialised yet, left: 5, right: 0.
  • loader:: + tls:: tests, 10 runs: 10 of 10 passed
  • e2e, 3 runs: 3 of 3 passed. The test title loads testgame_mw.dll with a TLS block through this loader (TLS: testgame_mw.dll: … threads initialized: 1 in its log) and starts threads afterwards.
  • D3D12 debug layer: the test title's XCL_D3D12_DEBUG=1 run logs the same set of debug-layer errors and warnings as on main.
  • SKIPPED (no wave64 on this adapter): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware

Not tested

  • The race itself (a title LoadLibrarying a DLL with TLS callbacks while another thread starts); a retail title; release build.

AI use

  • Claude Code (Claude Opus 5.5) ran the build and tests on the machine above, including the old-behaviour check, and wrote this report from the output.
<!-- greyfinch-sync:ivall/xcl:comment:7131748092 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1119#issuecomment-7131748092). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-11-24T12:39:44Z. --- NVIDIA run with the whole suite, since **Not tested** lists NVIDIA; the earlier check here ran the loader tests and a fixture. **Tested** - NVIDIA GeForce RTX 3060 12 GB (32-lane waves), driver 32.0.16.1088; AMD Ryzen 7 5700X; native Windows 11 Pro 26H2 (build 26300.9974), Graphics Tools (D3D12 debug layer) installed; rustc 1.100.0 `stable-x86_64-pc-windows-msvc`; DXC 1.9.2602.17; debug - **Exact head `df3676101e0a3f03f5ae35575bdbffc39c40d1ce`**, which is on current `main` `47efa2e` (so also the merged result): `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4`: **742 passed, 0 failed, 41 ignored**. The new `loader::tests::thread_callbacks_wait_for_a_dll_to_be_initialised` passed. - **Fails with the old behaviour, as you say:** the test calls the new `thread_event`, so I kept this PR's file and changed only `ready` back to "every module" (`|_m| true`, DllMain keeping its own `initialized` check, as before). The test fails with `callbacks of a DLL not initialised yet`, `left: 5, right: 0`. - `loader::` + `tls::` tests, 10 runs: **10 of 10 passed** - `e2e`, 3 runs: **3 of 3 passed**. The test title loads `testgame_mw.dll` with a TLS block through this loader (`TLS: testgame_mw.dll: … threads initialized: 1` in its log) and starts threads afterwards. - D3D12 debug layer: the test title's `XCL_D3D12_DEBUG=1` run logs the same set of debug-layer errors and warnings as on `main`. - SKIPPED (no wave64 on this adapter): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` **Not tested** - The race itself (a title `LoadLibrary`ing a DLL with TLS callbacks while another thread starts); a retail title; release build. **AI use** - Claude Code (Claude Opus 5.5) ran the build and tests on the machine above, including the old-behaviour check, and wrote this report from the output.
JoaoPauluu commented 2026-11-24 15:05:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T14:34:58Z.


A run on Linux under Wine.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. df36761 as it is (based on 47efa2e), no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact). Thread creation and the loader lock are Wine's here.
  • loader::tests::thread_callbacks_wait_for_a_dll_to_be_initialised: ok, no SKIPPED.

Not tested

  • whether the new tests fail without the change on this stack; the rest of the suite on this head; a retail title; native Windows.

AI use

  • Claude Code (Claude Opus 5.5) built the head, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
<!-- greyfinch-sync:ivall/xcl:comment:7134611758 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1119#issuecomment-7134611758). Originally posted by [JoaoPauluu](https://github.com/JoaoPauluu) on 2026-11-24T14:34:58Z. --- A run on Linux under Wine. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `df36761` as it is (based on `47efa2e`), no uncommitted changes. The lib test binary runs under Wine, one test per process (`--exact`). Thread creation and the loader lock are Wine's here. - `loader::tests::thread_callbacks_wait_for_a_dll_to_be_initialised`: **ok**, no SKIPPED. **Not tested** - whether the new tests fail without the change on this stack; the rest of the suite on this head; a retail title; native Windows. **AI use** - Claude Code (Claude Opus 5.5) built the head, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
wanchudao commented 2026-11-24 16:07:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by wanchudao on 2026-11-24T15:42:45Z.


Tested — df36761 on Windows 11 Pro build 26300, Ryzen 5 5500, MSVC 14.44.35207,
and rustc 1.100.0.

cargo test -p xcl --lib thread_callbacks_wait_for_a_dll_to_be_initialised -- --nocapture

Result: 1 passed, 0 failed, 0 ignored, 719 filtered out. This test exercises the
loader ordering on the CPU.

Not tested — Application behaviour beyond this synthetic unit test. The run
provides CPU-side coverage only.

AI use — DeepSeek Harness (DeepSeek V4.1 Flash) ran the test and drafted this report.
OpenAI Codex (GPT-6.2 Sol) checked the archived result and revised it.

<!-- greyfinch-sync:ivall/xcl:comment:7136484380 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1119#issuecomment-7136484380). Originally posted by [wanchudao](https://github.com/wanchudao) on 2026-11-24T15:42:45Z. --- **Tested** — df36761 on Windows 11 Pro build 26300, Ryzen 5 5500, MSVC 14.44.35207, and rustc 1.100.0. `cargo test -p xcl --lib thread_callbacks_wait_for_a_dll_to_be_initialised -- --nocapture` Result: 1 passed, 0 failed, 0 ignored, 719 filtered out. This test exercises the loader ordering on the CPU. **Not tested** — Application behaviour beyond this synthetic unit test. The run provides CPU-side coverage only. **AI use** — DeepSeek Harness (DeepSeek V4.1 Flash) ran the test and drafted this report. OpenAI Codex (GPT-6.2 Sol) checked the archived result and revised it.
DavidM1911 commented 2026-11-25 09:08:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T08:15:57Z.


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:7156813615 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1119#issuecomment-7156813615). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T08:15:57Z. --- 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!
throny commented 2026-11-28 14:57:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T14:57:02Z.


merge-check claim
head: df3676101e

<!-- greyfinch-sync:ivall/xcl:comment:7241063262 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1119#issuecomment-7241063262). Originally posted by [throny](https://github.com/throny) on 2026-11-28T14:57:02Z. --- merge-check claim head: df3676101e0a3f03f5ae35575bdbffc39c40d1ce
throny commented 2026-11-28 15:17:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T15:17:08Z.


merge-check
base: 309c3ec5
head: df3676101e
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2143 passed, 0 failed, 48 ignored (26 SKIPPED lines). Base alone at 309c3ec5: 2142 passed, 0 failed, 48 ignored.
review: no blocking finding; all hunks read. No new lock and the lock order is as on main. Behaviour to know: a thread created before a DLL's process attach has finished never gets that DLL's thread attach (as on Windows for threads that already exist), but still gets its thread detach later (also as on Windows). One difference from Windows remains: a thread created while a DllMain runs its process attach also misses the attach, where Windows would hold it on the loader lock and deliver it. The race the PR fixes was never reproduced in a title; the test shows the old behaviour failing. Minor: one check is now done twice.
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:7241348853 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1119#issuecomment-7241348853). Originally posted by [throny](https://github.com/throny) on 2026-11-28T15:17:08Z. --- merge-check base: 309c3ec5 head: df3676101e0a3f03f5ae35575bdbffc39c40d1ce merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2143 passed, 0 failed, 48 ignored (26 SKIPPED lines). Base alone at 309c3ec5: 2142 passed, 0 failed, 48 ignored. review: no blocking finding; all hunks read. No new lock and the lock order is as on main. Behaviour to know: a thread created before a DLL's process attach has finished never gets that DLL's thread attach (as on Windows for threads that already exist), but still gets its thread detach later (also as on Windows). One difference from Windows remains: a thread created while a DllMain runs its process attach also misses the attach, where Windows would hold it on the loader lock and deliver it. The race the PR fixes was never reproduced in a title; the test shows the old behaviour failing. Minor: one check is now done twice. 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).
relativespace2K commented 2026-11-30 01:56:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by relativespace2K on 2026-11-30T01:56:08Z.


merge-check
base: 53e85fb1
head: df3676101e
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2789 passed, 6 failed, 49 ignored; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (in --test gpu_two_pass_cache_e2e, so 5 failing tests give 6 failures). The same five fail on base 53e85fb1 alone (2788 passed, 6 failed, 49 ignored there), so none comes from this PR; its new test passed. 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused.
review: no blocking finding; 79 lines, one file, every hunk read. thread_event keeps the order the two old loops had (attach: TLS then DllMain, modules forward; detach: DllMain then TLS, modules reversed) and adds one filter: a module is ready when it is not a DLL or its PROCESS_ATTACH has run. That also drops DLL_THREAD_ATTACH TLS callbacks of a DLL still being mapped, which the old code called unconditionally; that is the point of the change (the code of a module that has not been initialised may not be executable) and it matches what the comment says. The executable is never marked initialised, so it keeps getting both callbacks, and the test asserts exactly that. No duplicate: no other PR or merged change carries this; searching DLL_THREAD_ATTACH finds only this one.
performance: two relaxed atomic loads per module per thread event, where the detach loop already loaded the same flags; nothing on any hot path.
verdict: safe to merge
hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.

<!-- greyfinch-sync:ivall/xcl:comment:7266564923 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1119#issuecomment-7266564923). Originally posted by [relativespace2K](https://github.com/relativespace2K) on 2026-11-30T01:56:08Z. --- merge-check base: 53e85fb1 head: df3676101e0a3f03f5ae35575bdbffc39c40d1ce merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2789 passed, 6 failed, 49 ignored; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (in `--test gpu_two_pass_cache_e2e`, so 5 failing tests give 6 failures). The same five fail on base 53e85fb1 alone (2788 passed, 6 failed, 49 ignored there), so none comes from this PR; its new test passed. 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused. review: no blocking finding; 79 lines, one file, every hunk read. `thread_event` keeps the order the two old loops had (attach: TLS then DllMain, modules forward; detach: DllMain then TLS, modules reversed) and adds one filter: a module is `ready` when it is not a DLL or its PROCESS_ATTACH has run. That also drops DLL_THREAD_ATTACH *TLS* callbacks of a DLL still being mapped, which the old code called unconditionally; that is the point of the change (the code of a module that has not been initialised may not be executable) and it matches what the comment says. The executable is never marked initialised, so it keeps getting both callbacks, and the test asserts exactly that. No duplicate: no other PR or merged change carries this; searching `DLL_THREAD_ATTACH` finds only this one. performance: two relaxed atomic loads per module per thread event, where the detach loop already loaded the same flags; nothing on any hot path. verdict: safe to merge hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.
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!1110
No description provided.