PE tests: cover section RVA boundaries on every host #2740
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2740
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2740"
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?
@XeNS1 on GitHub · 2026-11-25 19:24 UTC · original
XeNS1:codex/pe-section-rva-boundaries-20261126→main· +88 −4 · 1 files · 1 commits · openThe section RVA overflow regression parsed the host test executable, so it failed on Linux before reaching the mapper. The remaining section boundary behavior had no focused coverage for raw padding, zero-filled virtual tails, or multiple sections.
Use the existing source-generated PE fixture for that regression and check the last representable file offset and the first overflowing offset. Add four tests with explicit expected mappings for the smaller of virtual/raw size, zero VirtualSize, empty sections and gaps in both section orders, and RVAs near u32::MAX. Production code is unchanged. Header RVA/TLS work in #1639 and delay-import coverage in #2731 remain separate.
Validation (native Linux x86-64, Rust 1.100.0, two build jobs):
cargo test -p victory-pe --locked --offline -- --skip parses_own_test_binary --skip rva_to_file_offset_maps_entry_point --skip rejects_iat_outside_image: 37 passed, 0 failed. Those three unchanged tests need a Windows PE host executable; the baseline had 32 pass / 4 fail, including the now-portable overflow regression.f0d5342(run).Integration with #2731 at
694baa3also applies without conflicts: 41 portable PE tests pass, strict Clippy and staged policy pass (independent Linux report).All fixtures are generated from source. No game files, binaries or GPU execution used. AI-assisted: OpenAI Codex.
Coordination claim.
@fuzeofficlal on GitHub · 2026-11-25 20:14 UTC · original
Reviewed and verified
f0d53421on Windows 11 (rustc 1.98.1MSVC) againstmain(13f91ca).own_image()with the syntheticsection_image(virtual_size, raw_size)fixture makes the 4 GiB boundary test portable across hosts, and the 4 new tests thoroughly covermin(VirtualSize, SizeOfRawData),VirtualSize == 0, empty sections/gaps (both forward and reverse section orders), andu32::MAXwraparound avoidance.cargo test -p victory-pe --locked: 40 passed, 0 failed;cargo clippy -p victory-pe --all-targets --locked -- -D warnings: 0 warnings;cargo xtask policy: 184 files ok.git merge-treeagainst13f91caand#2741(complementary:#2740covers section RVA boundaries,#2741rejects null IAT RVAs in non-empty import descriptors).@oni-swr on GitHub · 2026-11-25 20:58 UTC · original
Independent WARP/CPU verification of
f0d53421(#2740).Review: Test-only change in
victory-pe/src/image.rs(no production change). The newsection_imagehelper builds a synthetic section, and the tests cover the shorter-of-virtual/raw-size rule,VirtualSize == 0, empty sections and gaps, section-table order, and RVAs nearu32::MAX. It no longer relies onown_image(). I found no problems.Results (WARP/CPU):
origin/main:cargo test -p victory-pe --lib: 36 passed.cargo clippy --locked -p victory-pe --all-targets [--all-features] -- -D warnings: clean.cargo test -p xtask(policy): 6 passed.Negative control (mutating
rva_to_file_offseton the PR head):vs.min(file_size)changed tovs:section_rvas_stop_at_the_shorter_of_virtual_and_raw_dataandsection_rvas_skip_empty_sections_and_gapsfail.checked_addchanged towrapping_add:rva_to_file_offset_rejects_offsets_past_4_gibfails.0 => file_sizechanged to0 => 0:section_rvas_use_raw_size_when_virtual_size_is_zerofails.Each mutation is caught, so the tests do guard the behaviour.
Method: no physical GPU.
VICTORY_WARP=1,VICTORY_D3D12_WARP=1, Windows SDK 10.0.26100dxil.dllonPATH, Windows 11, rustc 1.98.1 MSVC,--locked. Comparedorigin/main(13f91ca) with the PR head. The PR merges cleanly onto that main. No game files, dumps, shader names or retail hashes were used or are needed.AI disclosure: this verification was done by Claude Code / Claude Sonnet 5.5.
@Marvisak on GitHub · 2026-11-25 23:23 UTC · original
Automated triage for the maintainers.
Test-only change in
crates/victory-pe/src/image.rs:rva_to_file_offset_rejects_offsets_past_4_gibnow uses a source-built fixture (section_image) instead of the test executable and checks the exact last representable offset and the first overflowing one, and four new tests pinImageInfo::rva_to_file_offseton the shorter of VirtualSize/SizeOfRawData, VirtualSize 0, empty sections and gaps in both section orders, and RVAs nearu32::MAX. I worked the expected values through the currentrva_to_file_offset(thebackedextent andchecked_add) and they match; no production code changes, and it does not overlap the delay-import tests in #2731. CI (check) passes.This is a recommendation for a maintainer to look, not an approval.
Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-26 12:39 UTC · original · approved these changes
Reviewed and verified at head
f0d53421and merged ontoorigin/main(63bcca43) on Windows 11 (debug &--release):crates/victory-pe/src/image.rs:477-490, 547-626with zero production edits. Replacingown_image()with the source-builtsection_image(virtual_size, raw_size)helper makesrva_to_file_offset_rejects_offsets_past_4_gibportable across non-Windows hosts while pinning the exactu32::MAXboundary (0x1010 -> Some(u32::MAX),0x1011 -> None). The four new tests thoroughly covermin(VirtualSize, SizeOfRawData),VirtualSize == 0fallback toSizeOfRawData, empty sections and inter-section gaps in both forward and reversed section-table order, and wraparound nearu32::MAX.git merge-treeagainstorigin/main(63bcca43);cargo xtask policy(184 files ok);cargo clippy -p victory-pe --all-targets --locked -- -D warningsclean with default features and--all-features.cargo test -p victory-pe --locked: 40/40 passed in debug,--release, and merged ontoorigin/main(63bcca43).LGTM.
@futurepro62 on GitHub · 2026-11-26 12:57 UTC · original
NVIDIA full-suite run, to go with the reports above by fuzeofficlal, oni-swr, since none of them names a GPU run. Tested exact head
f0d5342(on its base13f91ca).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 777 passed, 0 failed, 9 ignored.section_rvas_stop_at_the_shorter_of_virtual_and_raw_data,section_rvas_use_raw_size_when_virtual_size_is_zero,section_rvas_skip_empty_sections_and_gaps,section_rvas_near_u32_max_do_not_wrap.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.