leonida-lua: the fake image starts on a page, so a scan below it no longer skips the marker (LEONIDA-LUA-SCAN-END-3193) #3244
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3244"
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 MoonEyes on 2026-12-02T22:09:23Z.
Claimed in the coordination issue as: LEONIDA-LUA-SCAN-END-3193 (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7360052872)
Fixes #3193
Depends on: #3237 (the same one-line build fix is included here, identical, so either merge order works)
What and why
a_scan_without_a_size_reaches_the_end_of_the_imagefailed about one run in twenty. The cause is in the test's fake, not in the scan. The fake title image was a plain 4096-byteVec<u8>at whatever address the allocator returned. The second scan starts 100 bytes below the image, so its range is not all readable andmemory::scanreads it by pages, skipping a page that cannot be read. In the fake a page only partly inside the buffer is unreadable, so when the buffer began within 100 bytes after a page boundary, the first page piece held the marker (atbase + size - 100) and was skipped whole:tail 1 0. A real image is made of whole pages, where this cannot happen, so the scan code is right as it is.The fake's 4096 bytes now start on a page boundary (
Image, a window of an over-allocated buffer, deref to[u8]so the other tests are unchanged).the_fake_image_starts_on_a_page_like_a_real_onepins it; the flake itself cannot be pinned directly because it depends on an allocator address.Also: the dangling-link test called
.unwrap()onRuntime::new, which no longer returns aResult(main's tests do not compile oncargo test -p leonida-lua --lib). The one-line fix is identical to #3237.Tested
Windows 11, no GPU, no game files, on
mainf3865cae8plus this branch:cargo test -p leonida-lua --lib the_fake_image->test result: FAILED. 0 passed; 1 failed(image at0x25b6f179cc0, offset 3264 in its page).cargo test -p leonida-lua --lib->test result: ok. 47 passed; 0 failed.a_scan_) 200 runs of the test binary: 0 failures;rustfmt --checkontests.rs: clean.GPUs tested: n/a
AI-assisted: yes (Claude Code). Models: Claude Opus 5.5 (author), separate Claude Opus 5.5 reviewers
Checklist
mainand merges cleanly.docs/design.md. (n/a: test fixture fix, no translator rule)🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T22:11:10Z.
Resolved on the current heads. After the revert in #3237,
git merge-tree --write-tree f69dd5036 a22fa26d6succeeds with no conflict.Earlier check for reference: Merge-order update for the
Depends onnote. Since the original one-line fix, #3237 gained a second commit that also changes the fake image fixture. I fetched both current PR heads andgit merge-tree --write-tree d75748c2c a22fa26d6reports a content conflict ind3d12/crates/leonida-lua/src/tests.rs. Once one lands, the other needs its remaining test changes reconciled withmainbefore a second merge.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-02T23:06:49Z.
Merging (OreoFR's OK). Head
a22fa26d64, mainef35d683e: merge-tree clean, all six checks green on this head (d3d12 windows included). Test-only change ind3d12/crates/leonida-lua/src/tests.rs; it also fixes main's d3d12 job (the.unwrap()onRuntimefrom #3179 and the scan test). Enqueued in the merge queue. (oreofr-agent, AI-assisted)