Repository navigation
kernelx: GetThreadName/SetThreadName set the Win32 error of NT failures - #1684
Conversation
SetThreadDescription and GetThreadDescription fail with HRESULT_FROM_NT of the status (0xD0000008 for a bad handle), which hresult_to_win32 did not recognise, so every failure set ERROR_INVALID_PARAMETER. Map the NT case through RtlNtStatusToDosError: a null handle now sets ERROR_INVALID_HANDLE, as measured on Windows 11 26300. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Test report on an NVIDIA card, head Tested
Regression run main: this PR's head: Not tested
AI use: Claude Code (Claude Opus 5.5) built the PR, ran the tests and both smoke runs, read the logs and wrote this report; I checked it before posting. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
PR #1684 verificationClean head Tested
Workspace failures and skips
Not tested Matched AI use T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against |
|
Independent desktop NVIDIA verification of PR #1684 at head Environment
Targeted tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib -- --nocapture get_thread_name_sizing_truncation_and_errors (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 830 filtered out × 3 (0.00s, 0.00s, 0.00s, 0 skipped) |
cargo test --release -p xcl --lib -- --nocapture hle::kernelx:: (3 consecutive runs) |
31 passed; 0 failed; 1 ignored; 799 filtered out × 3 (0.21s, 0.21s, 0.22s, 0 runtime skips; 1 pre-existing #[ignore] timing harness scatter_timing) |
cargo build --release -p xcl |
Clean build (1m 25s, exit 0, 0 new warnings in kernelx.rs) |
Paired quiet 60 s retail smoke (title: 29640639)
(Note: scripts/smoke.ps1 at c160d86e predates 9683e7a6 and printed the local folder basename on title:; replaced below with the standard 9683e7a6 title hash 29640639, with all measured fields verbatim.)
Exact parent & merge-base (c160d86ef2efe3a07e4dfb473e4fa72eafb413c0, cached baseline on the same machine):
xcl-smoke v1
commit: c160d86ef2efe3a07e4dfb473e4fa72eafb413c0
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1533 (PresentX 1533)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14721 MB
PR #1684 (bb6f91b58e8d9942abe80a3ff4f88f218e447581):
xcl-smoke v1
commit: bb6f91b58e8d9942abe80a3ff4f88f218e447581
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1555 (PresentX 1555)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14716 MB
Limits of coverage
get_thread_name_sizing_truncation_and_errorsand all31activehle::kernelx::tests (31/31executed,0runtime skips;1pre-existing#[ignore]scatter_timing) passed3/3on native Windows 1126200, directly verifying thathresult_to_win32mapsHRESULT_FROM_NTfailures fromGetThreadDescription/SetThreadDescriptionviaRtlNtStatusToDosErrortoERROR_INVALID_HANDLEon null handles.- Other
HRESULT_FROM_NTfailure codes beyond invalid thread handles were not individually probed, and the 60 s retail smoke confirms overall runtime stability (0device removals,0crashes, steady 60 Hz); single-run frame/commit delta vs. the cached parent reflects normal startup variance.
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
|
merge-check claim |
|
merge-check |
|
merge-check |
SetThreadNameandGetThreadNamepass on the failure ofSetThreadDescription/GetThreadDescriptionas a Win32 error throughhresult_to_win32. That function only understoodHRESULT_FROM_WIN32codes (0x8007xxxx) and setERROR_INVALID_PARAMETERfor everything else. Both functions fail withHRESULT_FROM_NTof the NT status instead: on Windows 11 26300, a null handle gives 0xD0000008, i.e. STATUS_INVALID_HANDLE with the NT facility bit. So a bad handle set error 87 instead ofERROR_INVALID_HANDLE(6), and a handle without access set 87 instead ofERROR_ACCESS_DENIED.hresult_to_win32now maps anHRESULT_FROM_NTcode back throughRtlNtStatusToDosError.What is in it
crates/xcl/src/hle/kernelx.rs: the NT case inhresult_to_win32, andRtlNtStatusToDosErrorin the existing ntdll import block. Testget_thread_name_sizing_truncation_and_errorsnow expectsERROR_INVALID_HANDLEfor a null handle from both functions; before, it only checked that some error was set.Tested
cargo test --workspace -- --test-threads=4on bb6f91b: 858 passed, 0 failed, 42 ignored; SKIPPED:heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)left: 87,right: 6(ERROR_INVALID_PARAMETER instead of ERROR_INVALID_HANDLE)Regression run
main:
this PR:
Not tested
GetThreadNamesets; this follows the existing function's intent of turning the HRESULT back into the Win32 error. The smoke title's run is a regression check only.AI use
🤖 Generated with Claude Code