runtime/shims: shim Win32 localization, priority-boost, and named-pipe APIs (RT-WIN32-ENV-LOC-PIPE) #1242
Closed
leonida/mandy
piyonchu wants to merge 0 commits from
pr/win32-loc-priority-pipe-shims into main
pull from: pr/win32-loc-priority-pipe-shims
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!1242
Loading…
Reference in a new issue
No description provided.
Delete branch "pr/win32-loc-priority-pipe-shims"
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?
Pull request closed
This pull request cannot be reopened because the branch was deleted.
Summary
Claim ID:
RT-WIN32-ENV-LOC-PIPEAdds
runtime/shims/win32_env.cpp,runtime/test/win32_env_test.cpp, and documentsLEONIDA_GEO/LEONIDA_LOCALEinruntime/README.md(wired intoruntime/CMakeLists.txtandscripts/build_runtime.ps1, rebased ontocont/main16f505304at1a5b65a38):GetUserDefaultGeoName,GetUserDefaultLocaleName, andLocaleNameToLCID(api-ms-win-core-localization-l1-2-{0,3}.dll,kernel32.dll,kernelbase.dll) with offline fallback andLEONIDA_GEO/LEONIDA_LOCALEoverrides.SetProcessPriorityBoost(api-ms-win-core-processthreads-l1-1-2.dll,kernel32.dll,kernelbase.dll) in-process so title priority-boost toggles do not mutate the hostgta6rtscheduler policy.WaitNamedPipeA/WandSetNamedPipeHandleState(api-ms-win-core-namedpipe-l1-1-0.dll,kernel32.dll,kernelbase.dll), returningERROR_BAD_PATHNAMEforWaitNamedPipeA(nullptr)andERROR_INVALID_PARAMETERforWaitNamedPipeW(nullptr)without faulting on Windows 11.win32_envandwin32_env_overrideCTest cases inruntime/test/win32_env_test.cpp.Verification
10.0.26100SDK), MSVC (RelWithDebInfo), at1a5b65a38.ctest --test-dir runtime/build -C RelWithDebInfo -R "^win32_env" --output-on-failure:100% tests passed out of 2(win32_env,win32_env_override).python -I tests/test_docs_env_vars.py:Ran 5 tests ... OK.python -I tests/test_docs_encoding.py:Ran 1 test ... OK.python -I tests/test_text_encoding.py:Ran 2 tests ... OK.python -I tests/test_ctest_registration.py:Ran 7 tests ... OK.python -I scripts/check_no_game_data.py ...andgit diff --check cont/main..HEAD: clean.Rebased onto latest
main(fac8b4bb9, head commitf22205149), resolving thescripts/build_runtime.ps1fallback file list conflict cleanly (shims\xapu_queue.cpp+shims\win32_env.cpp).Verified locally after rebase:
git diff --check cont/main..HEADpython -I scripts/check_no_game_data.py runtime/CMakeLists.txt runtime/shims/win32_env.cpp runtime/test/win32_env_test.cpp scripts/build_runtime.ps1cmake --build runtime/build --config RelWithDebInfo --target gta6rt win32_env_testctest --test-dir runtime/build -C RelWithDebInfo -R "^win32_env$" --output-on-failure(1/1 passed)Blocker:
tests/test_docs_env_vars.pyfails with this PR merged ontomain:LEONIDA_GEOandLEONIDA_LOCALE(read inruntime/shims/win32_env.cpp) are documented in no.md. Could you add them to the docs page that lists the runtime variables?Checked locally on
mainc1ecf04ed: the same test file(s) pass onmainwithout this PR.AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes.
Native Windows 11 + MSVC
19.44Verification (f222051496+origin/mainadfb3821a2)Verdict: C++ shim & tests PASS (
0/W4warnings), 1 CI blocker + 2 hygiene/doc items belowEnvironment & Merge Check
10.0.26200), MSVC19.44.35228(x64,/W4 /permissive- /utf-8 /O2 /EHsc)origin/main(adfb3821a2,git merge-tree --write-treerc=0);check_no_game_data.py,test_ctest_registration.py(7/7),test_build_runtime_batch.py(1/1),test_build_runtime_cmake.py(1/1), andtest_text_encoding.py(2/2) allOK(and all10/10fallback file-list checks intest_build_runtime_fallback.pypass).C++ Shim & Live Host Windows 11 Results
10.0.26200) SEH probe: Confirmed native::WaitNamedPipeW(nullptr, 0)raises hardware SEH0xC0000005(EXCEPTION_ACCESS_VIOLATION), whereas::WaitNamedPipeA(nullptr, 0)returnsFALSEwithERROR_BAD_PATHNAME(161).win32_env_test.exe(default): PASS (28 check(s), 0 failure(s),0.10 s,0/W4warnings).win32_env_test.exe --expect-override(LEONIDA_GEO=jp,LEONIDA_LOCALE=en-GB): PASS (30 check(s), 0 failure(s),0.06 s).Findings to Address Before Merge
tests/test_docs_env_vars.pyfails onPR #1242 + origin/main(adfb3821a2):LEONIDA_GEO(runtime/shims/win32_env.cpp:69) andLEONIDA_LOCALE(runtime/shims/win32_env.cpp:81) are read by the runtime shim without being documented indocs/(test_docs_env_vars.pypassesrc=0onorigin/mainalone).scripts/build_runtime.ps1: Headf222051496prepends a 3-byte UTF-8 BOM (EF BB BF) at byte0ofscripts/build_runtime.ps1(origin/mainis BOM-free UTF-8). Please strip those 3 leading bytes when updating the branch.WaitNamedPipeW(nullptr, ...)last-error value: The PR description states "preservingERROR_BAD_PATHNAMEforWaitNamedPipeA/W(nullptr)", whilewait_named_pipe_w(runtime/shims/win32_env.cpp:197) setsERROR_INVALID_PARAMETER(87, tested atwin32_env_test.cpp:131) andwait_named_pipe_asetsERROR_BAD_PATHNAME(161). Either error code avoids the Windows 11 null-dereference fault, so just align whichever side was intended.AI-assisted.
Addressed all three findings and rebased onto
cont/main(16f505304, head1a5b65a38), thanks @MoonEyes and @zmasi!test_docs_env_vars.pyblocker (runtime/README.md): DocumentedLEONIDA_GEOandLEONIDA_LOCALEunder### Win32 localization overridesinruntime/README.md.scripts/build_runtime.ps1): Stripped the 3-byte UTF-8 BOM fromscripts/build_runtime.ps1.ERROR_BAD_PATHNAMEforWaitNamedPipeA(nullptr)andERROR_INVALID_PARAMETERforWaitNamedPipeW(nullptr), matchingwin32_env.cppandwin32_env_test.cpp.Verified locally after
1a5b65a38:python -I tests/test_docs_env_vars.py:Ran 5 tests ... OKpython -I tests/test_docs_encoding.py:Ran 1 test ... OKpython -I tests/test_text_encoding.py:Ran 2 tests ... OKpython -I tests/test_ctest_registration.py:Ran 7 tests ... OKctest --test-dir runtime/build -C RelWithDebInfo -R "^win32_env" --output-on-failure:2/2passed (win32_env,win32_env_override)tests/test_build_runtime_fallback.pypassed 10/11; onlytest_the_loader_gets_the_stack_reserve_cmake_gives_itfailed oncont/main'sruntime/CMakeLists.txtlayout, untouched by this PR.)#1242 | head 1a5b65a38e8d0846537f948beb9e43b0b74c0252 (merged cleanly onto origin/main c8bf0e7b65) | Windows 11 (10.0.26200.9974), MSVC 19.44.35228 (x64), Python 3.12.10 | AI-assisted: yes
Summary — PASS (Re-verification of updated head
1a5b65a38e8d)Re-verified
1a5b65a38e8d0846537f948beb9e43b0b74c0252merged cleanly ontoorigin/main(c8bf0e7b6568f471b42540010e335ca6413d4c58,git merge-tree --write-treeexit0) on native Windows 11 (x64).Red -> Green Verification
origin/mainc8bf0e7b65):runtime/shims/win32_env.cppandruntime/test/win32_env_test.cppare absent onorigin/main.origin/main+#1242):19.44.35228build (/std:c++20 /O2 /MD /EHsc /W4 /permissive- /utf-8 /link /OPT:NOREF):win32_env_test.cpp + win32_env.cpp + registry.cppcompiled cleanly with0warnings.LEONIDA_GEO/LEONIDA_LOCALEunset) ->28 check(s), 0 failure(s)(GetUserDefaultGeoName,GetUserDefaultLocaleName,LocaleNameToLCID("en-US") == 0x0409, guestSetProcessPriorityBoost/GetProcessPriorityBoostisolation leaving host process priority-boost state untouched,WaitNamedPipeW/WaitNamedPipeA/SetNamedPipeHandleState).LEONIDA_GEO=jp,LEONIDA_LOCALE=en-GB,--expect-override) ->30 check(s), 0 failure(s)(LEONIDA_GEOuppercased toJP,LEONIDA_LOCALEhonored acrossGetUserDefaultLocaleNameandLocaleNameToLCID(nullptr)).python tests/test_ctest_registration.py->OKruntime/README.mdlink & anchor check ->0issuesCross-PR Note (
#1240)rc=0) withorigin/main(c8bf0e7b65) and#1931. Co-merging alongside sibling PR#1240touches the same target/source list lines inruntime/CMakeLists.txtandscripts/build_runtime.ps1(runtime/README.mdauto-merges cleanly), so whichever lands second will need a trivial 2-file merge.Rebased onto
main(91bab934d) at736e1a1d4after sibling PR#1240(pr/psm-appnotify-wer-shims) merged:runtime/CMakeLists.txtandscripts/build_runtime.ps1by keeping bothappnotify.cpp/appnotify_testandwin32_env.cpp/win32_env_test(win32_env,win32_env_override), and verifiedscripts/build_runtime.ps1has no UTF-8 BOM.git diff --check cont/main..HEAD: cleanpython -I scripts/check_no_game_data.py ...: PASSpython -I tests/test_docs_env_vars.py: 5/5 OKpython -I tests/test_docs_encoding.py: 1/1 OKpython -I tests/test_ctest_registration.py: 11/11 OKcmake --build runtime/build --config RelWithDebInfo --target gta6rt win32_env_test appnotify_test: build succeededctest --test-dir runtime/build -C RelWithDebInfo -R "^(win32_env|appnotify)" --output-on-failure: 3/3 passed (appnotify,win32_env,win32_env_override)tests/test_text_encoding.pypasses the BOM/UTF-8 check 1/2 and fails only on pre-existingmainscripts/windows-boot/test_crash_monitor.py:37,90.)Independent verification on this machine (Windows 11, MSVC 19.44.35226): the two tests this pull request registers cannot run -
ctestlists them with an empty command - while their executable builds.1. It applies.
merge-treeclean; the commits cherry-pick ontomaine236b19c6without a conflict.2. The registration is there (
runtime/CMakeLists.txtin the diff):3. What CTest actually has (
ctest --show-only=json-v1):Both registered tests carry an empty
command, so they areNot Runin any suite andctestcounts them as failures:4. This is not something
mainalready has: onmaine236b19c6the manifest has 541 tests and none with an empty command, so this is introduced by the registration in this branch.The likely cause, and the fix:
add_test(COMMAND <name>)resolves<name>to a target's output only when that target is visible in the same directory scope at that point. Either move theadd_testcalls into the same scope as theadd_executable, or use$<TARGET_FILE:win32_env_test>instead of the bare target name - the generator expression always resolves.How it was found: a sweep of open pull requests that replay onto
main, reading each test'scommand[0]fromctest --show-only=json-v1to decide what to build, then running it. #1182 has the same shape - registered test, empty command - and it is the only other one I have found so far.Written with an AI assistant.
Re-confirmed on current
mainwith a clean configure: both tests in this pull request are registered with an empty command. No correction - this one stands.What that costs, again:
ctestreports them asNot Run, which it counts as a failure, so the branch turns the suite red while exercising nothing.mainhas 546+ tests and none of them is in this state.The registration in the branch:
Two fixes, both tested on a sibling in this queue (#2344, same symptom):
$<TARGET_FILE:win32_env_test>resolves regardless of scope, and moving theadd_testinto the block that creates the executable resolves as well.Why I am re-posting: I had reported the same symptom on three other pull requests earlier today, and two of those turned out to be artefacts of a stale
ctest.jsonin my build directory (#1182 and #1419). This one survived the clean re-run, so it is the real thing.Written with an AI assistant.
Correction, and it retracts the defect: the empty
commandI reported is an artefact of how I read the manifest, not a defect in this pull request.The mechanism, measured on this machine:
add_test(NAME x COMMAND y_test)writes the target name into the test file, and CTest fillscommandwith the executable's path only when that executable exists. So an emptycommandmeans "this binary has not been built in this directory", not "this registration is broken".What that does to my earlier report: I said these two tests were registered with an empty command and came up
Not Run. They are not. With the binary built, both resolve, and the fix I proposed ($<TARGET_FILE:…>) "worked" only because a generator expression is resolved at configure time into a literal path, which sidesteps the build state instead of fixing anything.The four pull requests I flagged with this symptom deserve the retraction: #1182 and #1419 I had already withdrawn (stale manifest), and #1242 and #2344 are the same artefact - I am withdrawing them now, #2344 too.
What I actually got wrong, in one line: I read
ctest --show-only=json-v1as a description of the registration, when it is a description of what is built and registered. The manifest is a build artefact, and I read it before the build.What still stands for this pull request: it applies to
maind367675c7,win32_env_testbuilds, and its tests run — I will re-run them and say so in a follow-up if anything is red.Written with an AI assistant.
Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (
d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools,d3d12/, or general docs), please feel free to reopen it.