mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:35:52 +01:00
[PR #664] runtime: read PE files in blocks (RT-PE-BLOCK-READ) #704
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#704
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/664
Author: @sodove
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:perf/pe-block-reads📝 Commits (2)
291a96fruntime: read PE files in blocks (RT-PE-BLOCK-READ)d8cfc01tests: check whether the locked PE tail actually blocks CRT reads📊 Changes
2 files changed (+63 additions, -4 deletions)
View changed files
📝
runtime/src/pe_loader.cpp(+12 -4)📝
runtime/test/pe_loader_test.cpp(+51 -0)📄 Description
Claimed in the coordination issue as RT-PE-BLOCK-READ. The block-read implementation and original Wine measurements come from cobrabm12's finding.
The loader reads PE files in 64 KiB blocks while retaining Windows wide paths and shared opening. It reports an I/O error instead of treating a failed read as EOF. The regression fixture locks a trailing range after a complete synthetic PE prefix. On the base, the loader mapped that prefix and failed two assertions. With the change it reports the read error, retains no partial module, and can load the same fixture after the lock is released.
Verification
gta6rttarget builds.loader,pe_loader,pe_loader_bounds, andpe_loader_fuzzpass (4/4). The PE loader fixture passes all 85 checks.--dry-runon the same synthetic PE padded to 120 MiB, six timed runs per build after warm-up. Median fell from 397.6 ms on21625bcto 63.9 ms (6.22x). Both builds mapped two modules with zero unimplemented imports. This measures loading, mapping and binding the synthetic image.AI-assisted implementation and verification.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.