Repository navigation
Runtime: fix ANSI CP_ACP path encoding, HLE alias stubs/handles, forwarders, and stub creation race - #101
Merged
ivall merged 1 commit intoNov 23, 2026
Conversation
…solution, and stub race
Collaborator
|
Merged together with #95–#102 and checked on Windows 11 with an RX 9070: |
Ahmet-Dedeler
added a commit
to Ahmet-Dedeler/xcl
that referenced
this pull request
Nov 23, 2026
- kernelx: XMemIsToolsMemAvailable (TRUE; the title stops at an int3 on FALSE); XMemMapPhysicalPagesScatter without a page array unmaps the addresses. - xgameruntime: 128 vtable slots per object (later GDKs call past 96), the XDisplay HDR class (XDisplayTryEnableHdrMode: Disabled). - d3d12x: device xcl-dev#101 CreateStateObject from console code fails cleanly (E_NOTIMPL) instead of S_OK with no object. Dropped as upstream has its own: XG xcl-dev#10 GetResourceTiling, illegal-instruction bytes in the crash line. Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Ahmet-Dedeler
added a commit
to Ahmet-Dedeler/xcl
that referenced
this pull request
Nov 24, 2026
- kernelx: XMemIsToolsMemAvailable (TRUE; the title stops at an int3 on FALSE); XMemMapPhysicalPagesScatter without a page array unmaps the addresses. - xgameruntime: 128 vtable slots per object (later GDKs call past 96), the XDisplay HDR class (XDisplayTryEnableHdrMode: Disabled). - d3d12x: device xcl-dev#101 CreateStateObject from console code fails cleanly (E_NOTIMPL) instead of S_OK with no object. Dropped as upstream has its own: XG xcl-dev#10 GetResourceTiling, illegal-instruction bytes in the crash line. Co-Authored-By: Claude Mythos 5.2 <[email protected]>
burber
added a commit
to burber/xcl
that referenced
this pull request
Nov 24, 2026
…t pipeline waits; what list xcl-dev#101 takes Co-Authored-By: Claude Opus 5.5 <[email protected]>
kole07139
pushed a commit
to kole07139/xcl
that referenced
this pull request
Nov 25, 2026
The three lines of the first commit read "none / none / 0" in runs where the title had stopped after its first xcl-dev#101: no fence and no queue was behind, yet nothing was presented. What showed the stop was a SYNC_GRAPH cell whose recorded value is above what was submitted and completed, with no GPU wait armed: a list that writes the value was recorded and never submitted, so the submitting thread is held (GreemSC's runs, RX 7900 XT; the thread dump then named that thread). cells_behind_summary lists such cells, and those with armed waits: memory, completed, submitted (and on which queue), recorded and CPU values, and the armed waits with their age. It takes the graph with try_lock, since a dump can come while a submitting thread holds it. The function is GreemSC's, from the review of this PR. Co-authored-by: GreemSC <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XZrhsCAiLU1tTuEBwPLaRW
kole07139
pushed a commit
to kole07139/xcl
that referenced
this pull request
Nov 25, 2026
The three lines of the first commit read "none / none / 0" in runs where the title had stopped after its first xcl-dev#101: no fence and no queue was behind, yet nothing was presented. What showed the stop was a SYNC_GRAPH cell whose recorded value is above what was submitted and completed, with no GPU wait armed: a list that writes the value was recorded and never submitted, so the submitting thread is held (GreemSC's runs, RX 7900 XT; the thread dump then named that thread). cells_behind_summary lists such cells, and those with armed waits: memory, completed, submitted (and on which queue), recorded and CPU values, and the armed waits with their age. It takes the graph with try_lock, since a dump can come while a submitting thread holds it. The cell is read with ReadProcessMemory (dstorage::read_own), since the title can decommit its page at any time; an unreadable cell shows "mem unreadable" (bmjask's review). The function is GreemSC's, from the review of this PR. Co-authored-by: GreemSC <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XZrhsCAiLU1tTuEBwPLaRW
bmjask
referenced
this pull request
in bmjask/xcl
Nov 26, 2026
The three lines of the first commit read "none / none / 0" in runs where the title had stopped after its first #101: no fence and no queue was behind, yet nothing was presented. What showed the stop was a SYNC_GRAPH cell whose recorded value is above what was submitted and completed, with no GPU wait armed: a list that writes the value was recorded and never submitted, so the submitting thread is held (GreemSC's runs, RX 7900 XT; the thread dump then named that thread). cells_behind_summary lists such cells, and those with armed waits: memory, completed, submitted (and on which queue), recorded and CPU values, and the armed waits with their age. It takes the graph with try_lock, since a dump can come while a submitting thread holds it. The cell is read with ReadProcessMemory (dstorage::read_own), since the title can decommit its page at any time; an unreadable cell shows "mem unreadable" (bmjask's review). The function is GreemSC's, from the review of this PR. Co-authored-by: GreemSC <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XZrhsCAiLU1tTuEBwPLaRW
bmjask
referenced
this pull request
in bmjask/xcl
Nov 26, 2026
The three lines of the first commit read "none / none / 0" in runs where the title had stopped after its first #101: no fence and no queue was behind, yet nothing was presented. What showed the stop was a SYNC_GRAPH cell whose recorded value is above what was submitted and completed, with no GPU wait armed: a list that writes the value was recorded and never submitted, so the submitting thread is held (GreemSC's runs, RX 7900 XT; the thread dump then named that thread). cells_behind_summary lists such cells, and those with armed waits: memory, completed, submitted (and on which queue), recorded and CPU values, and the armed waits with their age. It takes the graph with try_lock, since a dump can come while a submitting thread holds it. The cell is read with ReadProcessMemory (dstorage::read_own), since the title can decommit its page at any time; an unreadable cell shows "mem unreadable" (bmjask's review). The function is GreemSC's, from the review of this PR. Co-authored-by: GreemSC <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XZrhsCAiLU1tTuEBwPLaRW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes ANSI path codepage encoding, HLE alias stub return codes,
GetModuleHandleparity for console-only aliases, ordinal/forwarder resolution, and amake_stub_infoTOCTOU race incrates/xcl/src/{util.rs, resolver.rs, stubs.rs, modules.rs, hle/kernelx.rs}:write_ansi_outCP_ACPencoding (util.rs):CP_ACPmatchesutil::from_ansi_ptr,vfs_hooks::w_to_a, and WindowsGetModuleFileNameA.WideCharToMultiByte(CP_ACP, ...)and character-boundary-safe truncation (binary-searching complete Unicode scalar-value UTF-16 prefixes so DBCS/UTF-8 multi-byte sequences and surrogate pairs are never split, settingERROR_INSUFFICIENT_BUFFERon truncation).GetACP() == 1252):C:\Jeux\Été\game.exe(CP1252) andC:\Hry\Český_Život\game.exe(CP1250) round-trip cleanly viafrom_ansi_ptr.C:\Games\漢\game.exe(CJK outside CP1250/CP1252) substitutes'?'(C:\Games\?\game.exe, NUL-terminated, matching WindowsGetModuleFileNameA) and round-trips on codepages representing'漢'.HLE alias stub return fallback (
stubs.rs,resolver.rs):StubDb::return_for_with_fallback(dll, fallback_dll, name)so routed HLE alias DLLs (xgameplatform.dll,xgameruntime.thunks.dll,d3d12x.dll, etc.) inherit their canonical module'sstubdb.tomldefault (E_NOTIMPL) instead of silently returning0(S_OK), while BOOL/handle families (kernelx.dll) keep0, per-alias overrides still win, and every stub call continues to be recorded inreport.json.GetModuleHandleW/A/Exparity for console-only aliases & loaded@stubDLLs (hle/kernelx.rs,modules.rs,resolver.rs):aliases_are_system()aliases, tries WindowsGetModuleHandleWfirst (preserving real handles forkernel32.dll, etc.) and falls back tomodules::hle_handle(m.name)when Windows returns0(advapi32legacy.dll,kernel32legacy.dll,minappmodelx.dll).Route::Stub, returnsmodules::find_hle_handle(&key).unwrap_or(0)so unloaded optional probes still return0while loaded@stubDLLs matchLoadLibrary.Ordinal fallback &
GetProcAddressforwarder contract (resolver.rs):resolve_hlefall through tosystem_proconly whenc == key(preventing cross-DLL ordinal mismatches on console-only aliases).allow_stubthroughresolve_export_of_mappedsoget_proc_addressreturnsNoneinstead of synthesizing stubs on unresolvable forwarders, and switched forwarder splitting torsplit_once('.')to support dotted DLL names.stubs::make_stub_infoTOCTOU race (stubs.rs):BY_KEYacross lookup, thunk allocation,ALLpush, and map insert (strict lock orderBY_KEY-> leafARENA/ALL), eliminating duplicate thunks and duplicateALLentries under concurrency.Testing
ansi_out_encodes_codepage_and_truncates_on_char_boundaries(CP1252, CP1250"Č"/"Ž", CJK'漢', CP932 DBCS, UTF-8 surrogate pair)make_stub_info_is_race_free_under_concurrency(8 threads × 50 iterations stress test)hle_alias_stubs_inherit_canonical_module_defaultordinal_imports_fall_through_only_to_matching_system_dllmapped_forwarders_preserve_get_proc_address_contract_and_dotted_dll_namesget_module_handle_matches_load_library_for_console_aliases_and_stubsbuiltin_db_parses_with_overridesorigin/main(60599a9):cargo build --workspaceandcargo test --workspace -- --test-threads=4pass with 0 failures and 0 new warnings.