startup: check the memory SRV report fields #1499
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1506"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Asimmimx on 2026-11-24T13:16:59Z.
Change
Refs #1149. Follow-up to #1420. This adds four cases to
startup_memory_srv_report, the device-free check ofsrc/startup_stubs/memory_srv_report.h. That header formats the log linelog_refused_memory_srvwrites when device slot 70 refuses a memory SRV.Two tests reach the header today:
startup_memory_srv_reportbuilds lines by hand;startup_address_srv_warpmatches five log lines by regex. In its lines the 2D view fields are all zero, and the address and destination match any hex value.So the view fields and the 64-bit values in the line were not checked exactly. 9 of 11 single-point mutants left both tests passing (table below), among them every 32-bit truncation of the address, the destination, the resource width and the buffer's first element. A refused call can carry 64-bit guest addresses and sizes, so a truncated value in this diagnostic would point at the wrong memory.
The new hand-worked lines:
0x200001000, destination0x123456780raw=00000001,00000002,00000006,00000002,3f000000,00000000) and no acceleration-structure note0x100001000and first element0x100000008The change touches only
tests/startup_memory_srv_report_check.cpp, which adds cases and changes no existing case, and two sentences in the "Buffer memory SRVs (device slot 70)" section ofdocs/startup-runtime.md. There is no CMake change.Verification
Commit
3c6273ac(main) plus this change,devpreset (Debug), Windows 11 Pro build 26300.9974, MSVC 19.51.36260, Windows SDK 10.0.26100.0, WARP 10.0.26100.9818.tests/docs_links_check.py,tests/bidi_controls_check.pyandgit diff --checkpassed.Mutation probe
I applied each mutation to the header alone, rebuilt
startup_memory_srv_report_check,startup_stream_consumerandd3d12_xs_shim, ran both tests, then reverted. None of this is committed.reason=label renameddest_in_view_heapandaddress_readableswappedThe
head >= sizetruncation guard inreport_viewis not pinned. The real caller always passes a 256-byte buffer, so the guard cannot be reached from it, and a>mutant behaves the same.Checklist
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T13:31:29Z.
Review: COMMENTED
Reviewed
0ae499c73e32d74d215eabd5095c9a248f654ff2:tests/startup_memory_srv_report_check.cppadds four exact-line cases checkingsrc/startup_stubs/memory_srv_report.h: distinct 2D-array view fields, 2D view with distinct mip/plane/fractional clamp and >4 GiBdest/address, cube-array raw 6-word dump (without the acceleration-structure note), and >4 GiBWidth/FirstElementon a raw buffer view.docs/startup-runtime.mddocuments the expanded check. Verified expected strings againstreport_resource,report_view, andreport_refused_memory_srvinsrc/startup_stubs/memory_srv_report.h.git diff --check origin/main..HEAD,python3 tests/docs_links_check.py(334 links across 16 files), andpython3 tests/bidi_controls_check.py(1223 files) all passed.--preset dev):startup_memory_srv_report_checkbuilt (3.73s);ctest --preset dev -R '^startup_memory_srv_report$' --parallel 4 --no-tests=error --output-on-failure— 1/1 passed (0.09s)./O2(--preset release):startup_memory_srv_report_checkbuilt (1.10s); same CTest filter — 1/1 passed (0.08s).Looks good to me.