cpu: reproduce load-config callback dispatch during EXE startup #896
Closed
opened 2026-11-23 16:36:07 +00:00 by R0Y00
·
7 comments
No Branch/Tag specified
main
codex/indirect-large-backed-views
codex/word3-preflight-check
codex/vertex-table-two-records
codex/live-index-alias
codex/copied-vertex-buffer-srv
codex/windows-stage-test-output
codex/preserve-live-srv-retirement
codex/share-render-target-tracking
codex/sgd5-negative-offset-fixture
coverage-dashboard
codex/mesh-loose-root
codex/mesh86-cache-padding
codex/xmem-scatter-preflight
codex/mesh-depth-ps
codex/indirect-dispatch-refresh
codex/compute-container-index
codex/startup-compute-formatted-load
codex/compute-indirect-producer
codex/compute-atomic-soffset
codex/mesh-dual-handoff
codex/startup-run-sh-watcher-control
codex/queue31-page-alias
codex/indexed-indirect-compute-root
codex/typed-buffer-view-metadata
codex/translated-indexed-address-alias
codex/fixed-mesh-create-result
codex/xmem-section-lease
codex/startup-slot86-mesh-cache
codex/restore-mesh-barrier-iteration
codex/translated-indirect-upload-index
codex/xapu-completion-opt-in
codex/translated-indexed-rect
codex/translated-indexed-indirect
codex/startup-mesh-lds-integration
codex/startup-console-ms24
codex/startup-slot57-mesh-request
codex/indirect-copy-provenance
codex/present-color-producer-trace
codex/compute-dispatch-binding-trace
codex/translated-indirect-table-buffers
codex/indirect-copy-provenance-base
codex/mix-half-literal-source
codex/translated-indirect-draw
codex/xmem-scatter-diagnostics
codex/slot148-recording-upload
codex/slot70-loading-art-verified
codex/command-list-upload-arena
codex/recover-failed-command-list
codex/startup-heap-timing-notes
codex/align-audio-input-timeline
codex/synthetic-depth-export-control
codex/startup-texture1d-on-windows
codex/1629-packed-position-fixture
codex/cpu-srv-refresh
codex/stream-root-srv-draw
codex/audio-mixer-timer
codex/startup-reload-published-shader
codex/priority-integrate-1284
codex/guest-sixteen-page-record
codex/aot-placed-dxr-batch
codex/guest-directory-selection
codex/gamesave-enumerate-read
codex/readme-archive-to-pixels
codex/pe-placed-view-draw
codex/archive-directory-gpu
codex/slot133-dxr-build
codex/materialize-placed-vertex-view
codex/dstorage-directory-offsets
codex/xg-nine-bc-copy
codex/xg-slot10-bc64-arrays
codex/dxr-guest-address-readback
codex/gpu-va-high-bits
codex/clarify-diagnostic-startup-scope
codex/xg-six-levels
codex/typed-derived-blend
codex/english-legal-text-progress
codex/address-bc-4ks
codex/dstorage-bounded-file-read
codex/wide-srv-offsets-menu
codex/startup-memory-srv
codex/bound-view-tail
codex/language-selector-readback
codex/setup-menu-progress
codex/cpu-plane-refresh
codex/startup-ubyte-vertex
codex/presenter-window-selection
codex/startup-uniform-buffer-lane
codex/intro-loop-timing
codex/static-clzero-loops
codex/document-rtx-intro
codex/startup-insertq
codex/nv12-startup-texture
codex/stream-stage-draw
codex/startup-null-uav-format
codex/startup-draw-capture
codex/shorten-windows-checks
codex/dstorage-rfc1950
codex/startup-dump-fence
codex/pr1135-review-base
codex/startup-stream-requests
codex/startup-chroma-view
codex/readme-graphics-pipeline-streams
codex/static-crt-free-tls
codex/arc-140t-rtx-5080-laptop-gpu-reports
codex/main-startup-progress-entry
codex/signed-dxil-catalogue
codex/reloc-free-preferred-base
codex/quad-dpp-bit-mask
codex/raw-srv-bounds
codex/rx9070-31044-hardware-report
codex/gpu-page-source-provenance
codex/runtime-placeholder-interior
codex/gpu-copy-queue-tile-order
codex/pe-pin-external-providers
codex/xmem-placeholder-reservations
codex/xmem-shared-physical-pages
codex/pe-package-startup
codex/xmem-tools-memory-query
codex/cpu-stack-output-import
codex/pe-load-security-cookie
codex/record-three-bvh-retests
codex/cpu-rbp-frame-anchor
codex/xmem-default-startup
codex/record-rtx-3050-ti-9597
codex/docs-readme-start-here
codex/check-compute-mad24-truncation
codex/docs-discord-community
codex/bound-rcx-branch-mutants
codex/rtx5060ti-bvh-62114
codex/837-neutral-readme-disclaimer
codex/record-rtx-3070-ti
codex/title-neutral-public-wording
codex/exe-shadow-frame-submissions
codex/exe-shadow-runtime-chain
codex/readme-polish
codex/gpu-coverage-nov23
codex/spirv-minlod
codex/shadow-shim-device
codex/exe-two-shadow-frames
codex/shim-dispatch-cleanup
codex/fix-spirv-cache-probe
codex/sampler-use
codex/ballot-bit-extract
codex/packed-fma-release
codex/cpu-packed-fma-o2
codex/publish-coverage-dashboard
codex/mesh-cbv-binding-order
codex/spirv-window-fixture
codex/ps-e32-float-uint
codex/ps-cbuffer-reads
codex/fixed-profile-rescan
codex/shim-compute-integration
codex/readme-visible-coverage
codex/readme-research-navigation
codex/integrate-pr-256
codex/indexed-mesh
codex/sampled-coverage
codex/first-ms
codex/dual-ps
codex/ps-attribute
codex/compute-first
codex/ps-export
codex/readme-research-status
codex/ps-layout
codex/blast-window
codex/chart-caption
codex/reviewer-roles
codex/blast-aot
codex/archive-program
codex/crc-stream-program
codex/exe-image-data-chain
codex/local-cpu-fixture-coverage
codex/exe-bound-frame-chain
codex/exe-mapped-comparison
codex/contribution-dependencies
codex/exe-entry-aot
codex/bink-frame-heap-integration
docs/hardware-seven-reports
codex/bink-custom-heap
codex/bink-heap-callers
codex/discussions-entry-points
codex/gpu-community-batch-64
codex/ffx-scratch-writers
codex/generic-project-documentation
codex/ffx-dispatch-rcas
codex/four-windows-gpu-reports
codex/title-neutral-project-wording
codex/community-coverage-provenance
codex/rcas-packed-texels
codex/community-gpu-retests
codex/community-build-and-gpu-reports
codex/ffx-provider-loop
codex/ffx-recurrent-views
codex/ffx-recurrent-resource
codex/amd-wave64-reports
codex/ffx-backend-slots
codex/upscaler-device-init
codex/ffx-context-lifecycle
codex/ffx-version-query
codex/ffx-provider-contract
codex/typed-object-callback
codex/cpu-ordinal-import
codex/chained-cpu-ranges
codex/cpu-import-call
codex/cpu-direct-call
codex/cpu-leaf-aot
codex/community-project-status
codex/script-state-path-replay
codex/script-state-evidence
codex/bc7-resident-tail
codex/bcpack-mip-tail
codex/bc7-texture-draw
codex/asset-ranges
codex/pixel-constants
codex/pixel-aot
codex/pre-exe-workloads
codex/root-signature-device-coverage
engineering/packed-bvh-leaves
engineering/bvh-build-and-update
engineering/intake-root-roundtrip
community/gpu-check-release
community/english-contributor-entry
gpu-check-v0.1.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
R0Y00/Xbox2Windows#896
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 R0Y00 on 2026-11-23T16:36:07Z.
Refs #870 and #317. Available to claim. Please post the test environment and any overlapping PR when claiming.
Build a source-only x64 Windows fixture that calls a typed startup callback through a load-config dispatch slot. Put both an absent callback and a callback from a relocated, read-only slot in the fixture. Keep the input image and provider identical when comparing Windows and
pe_map.Acceptance:
pe_mapsupports and report any refusal. Keep the CFG-enabled path subject to its original checks.The first contribution can be the fixture and results. The shared AOT binding and loader policy can be reviewed against it separately. Use source-built inputs and share the commands, commit and Windows build.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-23T16:47:03Z.
Claiming this.
Environment: Windows 11 Pro 26200, AMD Ryzen 5 5500, MSVC 19.52 (VS 2026 Build Tools), Windows SDK 10.0.26100 (DXC 1.9.2602.17), CMake/Ninja, Python 3.12,
devandreleasepresets.First pass is the source-built fixture and results, not a production loader or shim change. I plan to build a MASM caller that invokes a typed startup callback through a load-config dispatch slot, with:
pe_map;pe_mapdoes.I will record the load-config fields, relocation and slot permissions from the fixture's own PE, and use the existing
exe_startup/finish_exewrapper and live-worker control. Refs #870 and #317. Overlaps: #165 (source-built startup), #896 (tools-memory fixture), #902 (mapping); none changes the load-config dispatch path. If the fixture exposes a loader gap, I will report it separately rather than fold it into this slice.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-23T16:47:24Z.
Claiming this.
devpreset.__guard_dispatch_icall_fptror CFG. #899 is the closest landed work. It seeds the/GScookie from the same directory, and I'd reuse its CRT-freeexe_startup.asmpattern._load_config_usedwhoseGuardCFDispatchFunctionPointernames a read-only, relocated slot holding ajmp raxdispatcher.(int, int, int, void*)returning an int, through that slot for two read-only, relocated pointers. One pointer is null and is tested and skipped. The other names a callback that records its arguments and the number of calls.pe_map_runof the same image and provider, on exit code, recorded arguments and call count. It also records the relocation entries covering both slots, their section permissions and the load-config fields, read from the fixture's own PE./guard:cflink of the same source. I'll report what Windows writes into the check and dispatch slots, whether a valid target runs, and what an invalid target does natively. Forpe_mapI'll record what it currently does with that image, without relaxing any check. Any refusal or divergence is reported rather than worked around, so the loader policy can be reviewed separately.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T16:49:43Z.
Thanks to both of you for claiming this. @triggered02, please take the first source-built caller and trace, since you posted first. @denn0x, if willing, please review that candidate on your separate Windows environment and independently check the PE fields, observed call count and the negative control. Keep the CFG-enabled build separate and record observed behavior or a refusal using the original validation rules. This keeps the two contributions on one fixture.
Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-23T16:58:06Z.
Understood. @triggered02 has the caller and trace, and I won't open a competing PR. I'll review the candidate on this machine (Windows 11 build 26300.9974, Ryzen 7 7700, MSVC 19.50.35720) and check the PE fields, call count and negative control independently.
I had already built a local source-only prototype before the assignment, so here are its results as independent data points for the review and for the separate CFG build. Setup: a C++ caller compiled with
/guard:cfcalls through__guard_dispatch_icall_fptr, using a hand-written_load_config_used(size0x138). The callback table and both guard slots are in.rdata, each with a DIR64 relocation. Every function starts on a 16-byte boundary. Results are the same on thedevandreleasepresets.pe_map_run/guard:cf(GuardFlags0x100, noGUARD_CF)jmp rax, one call, expected args, absent entry zero calls/guard:cf(GuardFlags0x17500,GUARD_CFset), valid callback/guard:cf, target inside a function (absent from the function table)0xC0000409, before any outputThe GuardFlags values are as measured on link 14.50 and may differ on other MSVC versions. A target inside a function also runs under both loaders when the image is linked without
/guard:cf.Two things that may help the review:
IMAGE_GUARD_CF_INSTRUMENTED. Even with/guard:cfat link time, Windows then left both slots untouched here, so a CFG build needs at least one object compiled with/guard:cfbefore the loader applies the guard slots.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-23T16:59:02Z.
Fixture is in #914. Present/absent/alternate native and pe_map both return
0xb111/0xb211/0xb151; the PE check records the 0x138 load config, slot at directory+0x78, read-only.rdataand the DIR64 relocation. CFG: Windows refuses the hand-builtGuardFlags=0x100config before entry withSTATUS_DATA_ERROR(0xc000003e), while pe_map ignores GuardFlags and returns0xb111. That is recorded as a refusal/gap, not a pass; a linker-emitted valid CFG config is an open follow-up. No productionpe_mapchange.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-23T16:59:22Z.
Thanks @denn0x - #914 is up. The absent/present/alternate cases are the native-vs-
pe_mapmatches; the CFG variant is the hand-builtGuardFlags=0x100config, which Windows refuses before entry withSTATUS_DATA_ERROR(0xc000003e) whilepe_mapignoresGuardFlagsand returns0xb111. A PE-field/call-count review is exactly what I want, especially if you think the CFG case should use a linker-emitted config instead of this hand-built one.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T18:23:17Z.
Completed by #914. The merged source-built fixtures cover absent, present, and alternate callbacks, verify the read-only relocated slot, and compare the same inputs under Windows and pe_map. The separate linker-generated CFG build records the observed boundary: Windows rejects the invalid target, while pe_map currently executes it. Thanks @triggered02 and @denn0x for the fixture and independent evidence. Loader enforcement remains separate from this fixture.