Repository navigation
xmem: record the measured attribute words, and where 0x5e50000 comes from - #7704
bobcatchris wants to merge 2 commits into
Conversation
…from `runtime/shims/xmem.cpp` cited a call site that passes `0x5e50000` as the attribute word and kept the wording as an ASSUMPTION. That value is not in any image's import calls: it is the synthetic word in `runtime/test/xmem_test.cpp` (and the tiny bundled-DLL fixture). Measured over the executable — 23 `XMemVirtualAlloc` call sites from `tools/import_call_sites.py`, then the argument registers at each site — the `attributes` argument is one of eight constants (`0x3`, `0x7`, `0x21`, `0x23`, `0x27`, `0x181`, `0x183`, `0x283`) and the two `XMemAlloc` sites that pass a constant pass `0xf0814000`. None of them carries an alignment or memory-type field, which is what the 64-byte block alignment rests on, so the comment now records the measurement instead of the assumption. `docs/xmem_exe_calls.md` already listed those constants and said the `0x5e50000` came from another image; it now names the fixture it actually comes from, so the page and the comment agree. `tools/exe_checklist.py` drops the line (16 items to 15). AI-assisted.
|
AI-assisted review of e20ac5a. Please describe 64-byte heap alignment as a choice in the shim. The table in docs/xmem_exe_calls.md lists three XMemAlloc calls. It gives the attribute value for only two. The measurement does not establish the alignment requirement for the third call. The 23 XMemVirtualAlloc calls use a separate API. Five use allocation_type 0x20003000. The shim uses that argument to select 2 MiB alignment for a region that the host places. The eight attribute values do not establish that all callers request the same alignment. I checked the table against runtime/shims/xmem.cpp. I also ran py -3.14 -I tests/test_exe_checklist.py. All 11 tests passed. |
|
Addressed shdann's review at
Checks on Windows 11 (26200), Python 3.12.0:
Comment and docs only; no runtime behaviour changed and no C++ build was run. The checks used synthetic inputs and no game data. AI-assisted. |
|
AI-assisted recheck of |
|
Heads tested: 0e1a92a (force-pushed from e20ac5a) on main dde82f2, merges clean (tree 730866d00). C++/docs only — not runnable here, CI is the execution gate. Claims verified against the tree: the 23-site attribute table sums correctly, the eight constants in the new comment match it, 0x5e50000 appears only in xmem_test.cpp and the tiny_bundled_dll.cpp fixture, and the 2 MiB-alignment sentence matches the shim's kXmemLargePages handling (xmem.cpp:206). Exe citations carry tool + command + image SHA — the good pattern. The force-push's honest hedging (alignment as shim choice, attribute bits undecoded) is exactly right. No flags. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Read and tested 0e1a92a merged onto main 867d922 (clean merge) on Windows 11 build 26300, MSVC 19.44, Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, The text agrees with the code: the 64-byte heap alignment is now described as a choice, and the 2 MiB alignment as coming from AI-assisted (Claude Code). No game files. |
|
Checked Pass
Wording
AI-assisted: Codex GPT-6.2 Sol ran the checks, Claude Opus 5.5 reviewed the report. The executable was read in place (SHA-256 |
runtime/shims/xmem.cpp:9carried an ASSUMPTION that cited "one call site passes0x5e50000". That word is not an argument of any image's import calls — it is the synthetic value inruntime/test/xmem_test.cpp:74andruntime/test/fixtures/tiny_bundled_dll.cpp. The comment now says what the executable actually passes.Measured (Windows 11, MSVC 14.39,
tools/import_call_sites.pyovergame_scarlett_master.exefor the call sites, then the argument registers at each site withllvm-objdump):attributes(constant sites)XMemVirtualAlloc0x3,0x7,0x21,0x23,0x27,0x181,0x183,0x283XMemAlloc0xf0814000(2 of 3; the third is not a constant)Eight distinct words at the virtual-alloc sites, all below
0x400, none carrying an alignment or memory-type field — which is exactly what the shim's 64-byte block alignment rests on, so the assumption is now a measurement and the code does not change.docs/xmem_exe_calls.mdalready tabulated these constants and noted that0x5e50000"comes from another image"; it now names the fixture, so page and comment agree instead of pointing at each other.Checks.
tools/exe_checklist.pyreports 15 items instead of 16, with theruntime/shims/xmem.cpp:9line gone (the marker was the only thing keeping it there).tests/test_exe_checklist.pyOK. The two xmem test programs are unchanged and not affected: this is a comment and a doc page.This is the first page of the ASSET-379 sweep, as claimed on #7599. Constants and counts only, no game data.
AI-assisted.