runtime: replay the console list's inline records as their vtable calls (BL-3) #1050
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1050"
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 ubiquitarianism/leonida. Originally posted by baldyb4242 on 2026-11-24T17:20:53Z.
Claimed in the coordination issue as: BL-3 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7138403816)
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
Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T18:49:56Z.
Review: APPROVED
Clean-Room Audit & Architectural Review — PR #1050 (
BL-3Console Command List Record Decoder)Strong, clean-room implementation for BL-3!
Technical Verification
runtime/src/console_list_records.h):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).docs/boot_leads.md §BL-3noting the remaining proxy wiring and BL-4 widening items.runtime/test/console_list_records_test.cpp):Verdict: APPROVED
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T21:42:19Z.
#1050 | head
675c3fb1b9(merged cleanly with mainaa918e5d9f) |ctest --test-dir runtime/build -C RelWithDebInfo -R "^(console_list_records|command_list)$" --output-on-failure+python -m unittest tests/test_docs_encoding.py tests/test_docs_repo_paths.py| red on main:console_list_records_test.cppfails to compile (error C1083: Cannot open include file: 'console_list_records.h') | green on PR+main: 2/2 CTests pass on Windows 11 MSVC (console_list_records:1,200seeded sequences,13,190inline records replayed matching the vtable stream across all 9 forms and 11 refusal cases, pluscommand_list);test_docs_encoding.py,test_docs_repo_paths.py, andcheck_no_game_data.py0violations | Windows 11, MSVC 19.44, RTX 3090, Vulkan SDK 1.4.363.1 | AI-assisted: yesImported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T00:14:10Z.
Verified by OreoFR
a8465211f+ PR head675c3fb1b(merged with --no-ff, no conflict)ctest -R ^console_list_records$src/console_list_records.h, which this PR addsxbox_presentplusvk_compile_gate_calibration, which passed on rerunruntime/CMakeLists.txtwith the open #2566; a rebase may be needed if #2566 lands first.AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T02:15:33Z.
Verified by OreoFR: link check
59e65849b+ this PR (head675c3fb1b, the head verified earlier) merged with --no-ff, built without the XMA decoder (LEONIDA_CARGO=OFF, noLEONIDA_XMA2_DECODER_LIB: configure reports the XMA2 and Opus decoders not built), RelWithDebInfo, Ninja, MSVC 19.44.35230 (VS 2022 BuildTools),LEONIDA_REQUIRE_VULKAN=ONgta6rt.exelinks; imports unchanged vs main built the same way (dumpbin /imports: 25 DLLs, 655 functions, no WS2_32)AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T08:33:45Z.
@baldyb4242 this PR now conflicts with
main(runtime/CMakeLists.txt). Could you mergemaininto your branch (no force-push needed)? It was verified before the conflict: https://github.com/ProjectLeonida/mandy/pull/1050#issuecomment-7247970937. If there's no update within 24 h, OreoFR may carry it in a new PR that keeps you as co-author (per the maintainers' plan). — OreoFR's agent (AI-assisted)Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-30T13:24:48Z.
Carried as #2716 because of the conflict with main after #2566; @baldyb4242, if you come back, say so and the carry is dropped.