kernelx: GetThreadName/SetThreadName set the Win32 error of NT failures #1684
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1684
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1684"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@emirduran707 on GitHub · 2026-11-24 19:15 UTC · original
emirduran707:kernelx-thread-name-error→main· +9 −2 · 1 files · 1 commits · openSetThreadNameandGetThreadNamepass 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=4onbb6f91b: 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
@MiharaxD on GitHub · 2026-11-24 21:44 UTC · original
Test report on an NVIDIA card, head
bb6f91b(onmainc160d86), which covers the "NVIDIA" line.Tested
cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4(debug) onbb6f91b: 858 passed, 0 failed, 42 ignored (lib tests 809 / 0 / 22).gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64).Regression run
scripts/smoke.ps1 -Game <game folder> -Seconds 60(release builds, start screen, no input).mainisc160d86:main:
this PR's head:
Not tested
GetThreadName/SetThreadName: the smoke run is a regression check only.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.
@DavidM1911 on GitHub · 2026-11-24 21:47 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@JJAutoCompare on GitHub · 2026-11-25 04:44 UTC · original
PR #1684 verification
Clean head
bb6f91b58e8d9942abe80a3ff4f88f218e447581on STOR-WINLAB. Windows 11 x64 (10.0.26200.9974), AMD Ryzen 7 3800X, Intel Arc A770 (16 GB, driver 32.0.101.9175), DXC 1.9.2609.5, and rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc).Tested
cargo build --workspaceandcargo test --workspace --no-runboth exited 0 outside the Arc lock. Test compilation produced 19 test binaries. Dev and test profiles were unoptimized, with debug info and incremental compilation disabled.cargo test -p xcl --lib hle::kernelx::tests::get_thread_name_sizing_truncation_and_errors -- --exact --nocapturewithXCL_ADAPTER=NONE_CPU_ONLYoutside the lock. 1 passed, 0 failed, 0 ignored, 0 explicit skips. The test incrates/xcl/src/hle/kernelx.rsverified that bothGetThreadNameandSetThreadNamereturn FALSE and setERROR_INVALID_HANDLEfor a null thread handle. It also checked name round trips, empty names, buffer sizing, and null-buffer validation.cargo test --workspace --no-fail-fast -- --test-threads=4ran once insideInvoke-ArcTest.ps1withXCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1. Exit 101. The 20 result summaries inpr1684-suite.log(19 test binaries and one doc-test harness) totaled 840 passed, 18 failed, and 42 ignored. The thread-name test passed again.Workspace failures and skips
CreateComputePipelineStateerror0x80070057. The other four reported output mismatches involving fused multiply-add, implicit mip LOD, f16 output, and wave64 pixel reductions. One end-to-end test failed because the test title'sRSSetDepthBiasXcheck read a blue pixel where it expected green.SKIPPED. The reasons were unavailable wave64 (2), tiled-resource tier below 2 (1), unavailable heap windows (1), and missing debug-layer support (2). These skips provide no coverage.Not tested
Matched
mainrun, retail title smoke, and other GPUs.XCL_SAMPLE_*inputs were unset. The workspace failures have no matched baseline for comparison.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
pr1684-suite.logand published.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.