inline_scan: follow a list copied before the cursor load (INLINE-SCAN-COPY-BEFORE-LOAD) #2318
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2318
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/inline-scan-copy-before-load"
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 successfully merged and closed
Claimed in the coordination issue as: INLINE-SCAN-COPY-BEFORE-LOAD (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7193762634)
What and why
tools/inline_scan.pyexists to say whether every inline command-list write checks the cursor limit; "UNCHECKED 0" is the answer the day-one check indocs/design.mdreads as "a cursor-at-limit layer sees every command".classify()walks backwards from a store-backmov [rbx+18h],raxand accepted the cursor loadmov rax,[rcx+18h]only if rcx was already known to hold the list at that point of the walk. Whenthisis copied first:the walk meets the load before the copy, so the load was taken for another structure's
+18h,load_tracedwas False and the write was reported asunrelated. The summary saidUNCHECKED 0and counted it among the "cursor-like stores with no list field nearby". The same write with the list in rbx throughout, or with the copy after the load, is UNCHECKED, and the checked form of this exact shape is already a test (test_list_copied_to_another_register_is_followed), found only because the compare pass runs forwards over the final register set.The load's base is now recorded and checked after the walk, against every register the list was copied through. A load from a register that never held the list still marks the site as another structure. Checked sites do not depend on the load, so the change can only move a site from
unrelatedtoUNCHECKED; the counts indocs/d3d12_command_objects.md(every DLL site checked) cannot change, but I could not re-run them here (no game files).Tested
Windows 11, Python 3.14.7, synthetic dumpbin-style listings only:
python -I tests/test_inline_scan.py: 16 tests OK. Newtest_list_copied_before_the_cursor_load_is_still_uncheckedruns the unchecked write with the copy before and after the load; onmainthe copy-before-load case fails (listis False), with the fix both are UNCHECKED with the cursor traced and size 0x10. Newtest_cursor_loaded_from_another_structure_is_not_a_listkeeps a load through a register that is never a copy of the list (rsi) out of the list sites.python -I tests/test_cpu_feature_scan.py(importsinline_scan) OK; the test of open #536 (test_inline_scan_extra.py) also passes on this branch.python -m compileall;scripts/check_no_game_data.pyon both files.read_linesandmainin the same file (different topic).GPUs tested: n/a (CPU-only tool)
AI-assisted: yes (Claude Code, Claude Opus 5.5)
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
Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.
(AI-assisted triage.)
Now ready for review and
MERGEABLE. Clean-room verified: the deferredload_basecheck intools/inline_scan.py:94-108and synthetic regression test intests/test_inline_scan.pyare clean and independently verified on Windows and macOS (@lixonik,@wavehs).Approving — ready to merge once CI runs green on current
main.(AI-assisted review.)