mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:30:53 +01:00
[PR #1050] runtime: replay the console list's inline records as their vtable calls (BL-3) #1087
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1087
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1050
Author: @baldyb4242
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:bl3/console-slot-drop-check📝 Commits (1)
675c3fbruntime: replay the console list's inline records as their vtable calls (BL-3)📊 Changes
4 files changed (+490 additions, -0 deletions)
View changed files
📝
docs/boot_leads.md(+5 -0)📝
runtime/CMakeLists.txt(+4 -0)➕
runtime/src/console_list_records.h(+183 -0)➕
runtime/test/console_list_records_test.cpp(+298 -0)📄 Description
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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.