Repository navigation
runtime: replay the console list's inline records as their vtable calls (BL-3) - #1050
baldyb4242 wants to merge 1 commit into
Conversation
…ls (BL-3) A console DLL writes a command into the list object while it has room instead of calling the vtable (docs/d3d12_command_objects.md §3.5a). The list proxy avoids this today by pinning the cursor at its limit; an inline write the title makes without checking first would be lost. console_list_records.h decodes the measured records (the two dispatch headers, root constants, descriptor table, root CBV/SRV/UAV, pipeline record) into the fallback calls (slots 14, 80, 37, 39, 35, 41/43/45, 25), using a root-argument header table this runtime defines. An unknown or truncated record stops decoding with its offset instead of being skipped. console_list_records_test models the DLL independently from the doc and runs 1,200 seeded sequences at six cursor limits: the inline path (replayed before each vtable call and at Close) and the all-vtable path give the same calls. Eight planted decoder bugs each fail it. Not yet wired into runtime/shims/d3d12_xs_device.cpp (Windows-only, not buildable here). No game files, no GPU. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Clean-Room Audit & Architectural Review — PR #1050 (BL-3 Console Command List Record Decoder)
Strong, clean-room implementation for BL-3!
Technical Verification
- Inline Record Decoding (
runtime/src/console_list_records.h):- Decodes the measured inline forms from
docs/d3d12_command_objects.md §3.5a(0x4002C400-> slot 14Dispatch,0x4003CC00-> slot 80, root constants slots 37/39, root table slot 35, root CBV/SRV/UAV slots 41/43/45, and 28-byte pipeline record -> slot 25SetPipelineState). - Stops cleanly at the exact byte offset on unknown/truncated/misaligned records rather than skipping bytes.
- Accurately updates
docs/boot_leads.md §BL-3noting the remaining proxy wiring and BL-4 widening items.
- Decodes the measured inline forms from
- Synthetic Verification (
runtime/test/console_list_records_test.cpp):- Verifies header bitfields don't collide with dispatch headers or overflow across max parameters/constants, tests all 9 record forms and refusal paths, and validates inline-vs-vtable stream equivalence across 1,200 seeded sequences.
- Clean-Room Compliance:
- 0 retail files or keys; C++20 stdlib + synthetic tests only.
Verdict: APPROVED
…16-minmax-neg-zero-test Shaders: negative-zero ordering test for the f16 min/max forms
|
#1050 | head 675c3fb (merged cleanly with main aa918e5) | |
|
Verified by OreoFR
AI-assisted (Claude Code, Claude Opus 5.5). |
|
Verified by OreoFR: link check
AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR. |
Claimed in the coordination issue as: BL-3 (#14 (comment))
What and why
A console DLL writes a command into the list object itself while the list has room, instead of calling the vtable (
docs/d3d12_command_objects.md§3.5a). The list proxy avoids this today by keeping the cursor at its limit, so every command goes through the vtable. An inline write the title makes without checking the cursor first would be lost.This adds the decoder half of BL-3:
runtime/src/console_list_records.hdecodes the measured inline records into the vtable calls they replace:0x4002C400dispatch0x4003CC00dispatch with an extra wordThe root-argument header is the list's table entry at
+0x344, which the runtime fills. The header defines an encoding for it that keeps bits 30–31 clear (the DLL writes inline only then) and leaves room for the DLL's measured+ 4*offsetand+ ((n-1) << 16)adjustments.An unknown or truncated record stops decoding and reports its offset. It is never skipped.
docs/boot_leads.md: a status line for BL-3.Not in this PR (draft for that reason):
runtime/shims/d3d12_xs_device.cpp: replay pending records before each vtable call and at Close.Slot 80 →
Dispatchon the vtable path is #687's change and is not duplicated here.Tested
console_list_records_test(new) models the DLL independently from §3.5a. It runs 1,200 seeded sequences at six cursor limits (0 to 4,096 bytes), and the inline path and the all-vtable path give the same call stream (13,190 commands written inline and replayed). It also has one case per measured form and 11 refusal cases.cteston macOS (AppleClang 21, Apple Silicon): 75/75 passed, 2 skipped (shader_library_corpusandvk_sync_validationneed game files). Before the change: 72/72.-Wall -Wextra -Wpedantic -Werror.check_no_game_data.pypasses on the changed files.GPUs tested: n/a (CPU-only test)
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code