Repository navigation
fix(libkernel): stabilize virtual-query layout across hosts - #5611
Conversation
CnRJay
left a comment
There was a problem hiding this comment.
The fix is right. uint32_t bitfields under MinGW's ms_struct layout take a 4-byte allocation unit, which moves name to 36 and gpu_mask_id to 68. Byte-sized units give the SysV offsets on both hosts. The offsetof asserts are the right guard, since the size alone hid this.
One convention point: the PR adds a code comment above the bitfields ("A byte-sized allocation unit also preserves the guest layout under MS bitfields."). CONVENTIONS.md only allows comments that mark technical debt, written by a human. The explanation is already in the debt entry, and the static_asserts document the constraint in code, so the comment can go.
|
Removed the redundant code comment in AI-assisted: yes. |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Checked on the merged tree: build and ctest for |
cd28fc9 to
ad78fbc
Compare
|
Checked on the merged tree: build and ctest for |
What
On MinGW, VirtualQueryInfo's 32-bit flag allocation unit puts
nameat byte 36 andgpu_mask_idat byte 68; SysV puts them at 33 and 65. Both structures are 72 bytes, so a size check misses the discrepancy. Use byte-sized flag units and assert size, alignment and trailing field offsets. A named-mapping regression checks fixed byte offsets, canaries and cleared padding.This preserves the existing SysV contract. Astro's bundled AGC supports the 72-byte size and address/protection fields; console name and GPU-mask offsets remain unmeasured and are recorded in the library debt file.
Refreshed as one linear topic commit
ad78fbcdf78d5a93f0ca3f9d79eff68adad4b38bon main705b32d91986c02b2ba39ffcef3fff548a6dba68. The only merge conflict was additive debt text. Current main's complete debt file is retained, with this topic's entry appended. Source and test changes apply cleanly. No merge commits remain.Tested
Current refresh, Linux x86-64, GCC, Ryzen 9 7950X:
libs,guest_memory_testsandpatched_libraries_teststargets build successfully.guest_memoryandpatched_libraries: 2/2 pass, no skips, 0.67 seconds. This runs the raw-byte layout and canary regression with the current memory implementation.The local runtime build uses a private SPIRV-Tools teardown repair
b326807c0c9d8682b697fdad3153f77fc2642f5f; its only tree difference from the published topic is that gitlink, which is not part of this PR. The official dependency revision was not independently validated by this local build. Full Linux/Windows suite results for this refreshed head are pending maintainer CI.Historical full CI, earlier topic/base only: topic
cd28fc97e08b16e42d50f04a6d7ac4fcf3950dc1against base45d99dac82a9ad1ab8a7b1ff4ab8141e33cf920dpassed Linux hosted validation (1105 passed /52 skipped) and Windows validation (757 passed /423 skipped). Skipped cases remain unvalidated. An earlier unchanged Windows guest_memory job needed a rerun after a resident-mapping assertion; the cause was not established. Those historical runs do not establish full-suite success for the new head.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository