Tests: expand low_va integration tests for PE header and directory invariants #2157

Merged
heditrigui merged 1 commit from upstream-pr/2167 into main 2026-11-30 03:04:57 +00:00
heditrigui commented 2026-11-25 07:01:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by heditrigui on 2026-11-25T07:01:00Z.


Summary

Expands link-time validation in crates/xcl/tests/low_va.rs to verify essential PE characteristics of xcl.exe:

  • Validates that xcl.exe is built with IMAGE_FILE_LARGE_ADDRESS_AWARE (0x0020) and configured with IMAGE_SUBSYSTEM_WINDOWS_CUI (3) for the AMD64 architecture.
  • Validates that the PE TLS data directory (DIR_TLS = 9) is present and non-empty, ensuring the host mode TLS callback (.CRT$XLY) is preserved by the linker.
  • Validates that the exception directory (DIR_EXCEPTION = 3) is present and non-empty for x64 stack unwinding.

Tested

  • python -m pytest scripts/ (25 passed in 0.58s).
  • Validated with scripts/pr_check.py --local.

Not tested

  • Retail game smoke execution (tests/ integration suites are non-runtime code).

AI use

  • Antigravity (Gemini 3.8 Flash (High))
<!-- greyfinch-sync:ivall/xcl:issue:5486753283 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2167). Originally posted by [heditrigui](https://github.com/heditrigui) on 2026-11-25T07:01:00Z. --- ### Summary Expands link-time validation in `crates/xcl/tests/low_va.rs` to verify essential PE characteristics of `xcl.exe`: - Validates that `xcl.exe` is built with `IMAGE_FILE_LARGE_ADDRESS_AWARE` (0x0020) and configured with `IMAGE_SUBSYSTEM_WINDOWS_CUI` (3) for the AMD64 architecture. - Validates that the PE TLS data directory (`DIR_TLS` = 9) is present and non-empty, ensuring the host mode TLS callback (`.CRT$XLY`) is preserved by the linker. - Validates that the exception directory (`DIR_EXCEPTION` = 3) is present and non-empty for x64 stack unwinding. **Tested** - `python -m pytest scripts/` (25 passed in 0.58s). - Validated with `scripts/pr_check.py --local`. **Not tested** - Retail game smoke execution (`tests/` integration suites are non-runtime code). **AI use** - Antigravity (Gemini 3.8 Flash (High))
DavidM1911 commented 2026-11-25 08:08:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T07:20:38Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7155754984 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2167#issuecomment-7155754984). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T07:20:38Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
raylitebull commented 2026-11-25 11:09:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T10:48:33Z.


Code review on fa26aa7:

  • Adding xcl_exe_is_linked_with_large_address_aware_and_cui_subsystem and xcl_exe_contains_valid_tls_and_exception_directories in crates/xcl/tests/low_va.rs cleanly verifies PE link characteristics (LARGE_ADDRESS_AWARE, CUI subsystem, .CRT$XLY TLS, .pdata exception directory), with both CI checks green.

Remaining before merge: Independent verification on fa26aa7 (currently has @DavidM1911 --lib only, which doesn't execute integration test targets like --test low_va).

<!-- greyfinch-sync:ivall/xcl:comment:7160201349 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2167#issuecomment-7160201349). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T10:48:33Z. --- Code review on `fa26aa7`: - Adding `xcl_exe_is_linked_with_large_address_aware_and_cui_subsystem` and `xcl_exe_contains_valid_tls_and_exception_directories` in `crates/xcl/tests/low_va.rs` cleanly verifies PE link characteristics (`LARGE_ADDRESS_AWARE`, CUI subsystem, `.CRT$XLY` TLS, `.pdata` exception directory), with both CI checks green. **Remaining before merge:** Independent verification on `fa26aa7` (currently has `@DavidM1911` `--lib` only, which doesn't execute integration test targets like `--test low_va`).
tiagonleal commented 2026-11-25 13:05:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-25T12:32:58Z.


Verification on NVIDIA RTX 5070 Ti (Windows 11), head fa26aa785d51878afc6b95087fefd5253c0d58af

Tested

  • Head fa26aa785d51878afc6b95087fefd5253c0d58af (git rev-parse HEAD of a clean worktree, no local changes, built as is). The PR was open and the head unchanged when I started and again before writing this.
  • Windows 11 Pro 10.0.26300 (Developer Mode off), NVIDIA GeForce RTX 5070 Ti 16 GB (driver 32.0.16.1742), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), cargo 1.100.0, debug profile (the cargo test default).
  • The PR changes crates/xcl/tests/low_va.rs, so I ran that target and not --lib: cargo test -p xcl --test low_va -- --test-threads=4 --nocapture: 3 passed, 0 failed, 0 ignored (about 20 s including an incremental build). Tests: xcl_exe_is_linked_with_large_address_aware_and_cui_subsystem, xcl_exe_is_linked_without_high_entropy_va, xcl_exe_contains_valid_tls_and_exception_directories. The earlier verification in the thread ran only --lib, which does not execute this target.
  • No SKIPPED lines in the output.

Not tested

  • An AMD host.
  • cargo test --workspace, --lib and the other test targets; release profile; Developer Mode on (off here); the retail game and xcl-smoke.

AI use

  • Claude Code created the clean worktree, built and ran the test target above, and wrote this report. No code was changed.

Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7162525115 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2167#issuecomment-7162525115). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-25T12:32:58Z. --- Verification on NVIDIA RTX 5070 Ti (Windows 11), head `fa26aa785d51878afc6b95087fefd5253c0d58af` **Tested** - Head `fa26aa785d51878afc6b95087fefd5253c0d58af` (`git rev-parse HEAD` of a clean worktree, no local changes, built as is). The PR was open and the head unchanged when I started and again before writing this. - Windows 11 Pro 10.0.26300 (Developer Mode off), NVIDIA GeForce RTX 5070 Ti 16 GB (driver 32.0.16.1742), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), cargo 1.100.0, debug profile (the `cargo test` default). - The PR changes `crates/xcl/tests/low_va.rs`, so I ran that target and not `--lib`: `cargo test -p xcl --test low_va -- --test-threads=4 --nocapture`: 3 passed, 0 failed, 0 ignored (about 20 s including an incremental build). Tests: `xcl_exe_is_linked_with_large_address_aware_and_cui_subsystem`, `xcl_exe_is_linked_without_high_entropy_va`, `xcl_exe_contains_valid_tls_and_exception_directories`. The earlier verification in the thread ran only `--lib`, which does not execute this target. - No `SKIPPED` lines in the output. **Not tested** - An AMD host. - `cargo test --workspace`, `--lib` and the other test targets; release profile; Developer Mode on (off here); the retail game and `xcl-smoke`. **AI use** - Claude Code created the clean worktree, built and ran the test target above, and wrote this report. No code was changed. Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5).
Decodere commented 2026-11-27 10:03:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T10:03:46Z.


Independent desktop NVIDIA verification of PR #2167 at head fa26aa785d51878afc6b95087fefd5253c0d58af (1 commit; exact parent & merge-base: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12, Wave32-only Ada), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted tests & build (fa26aa78)

Command Result
cargo build --release -p xcl Clean build (0.07s incremental --release build, exit 0, 0 new warnings)
cargo test --release -p xcl --test low_va -- --nocapture (3 consecutive runs) 3 passed; 0 failed; 0 ignored; 0 filtered out × 3 (0.01s, 0.01s, 0.01s, 0 skipped; verified xcl_exe_is_linked_without_high_entropy_va, xcl_exe_is_linked_with_large_address_aware_and_cui_subsystem, and xcl_exe_contains_valid_tls_and_exception_directories against the freshly built --release xcl.exe)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (568e7db7729c8fa6c8f0f4b32d798faaf11462bb, cached baseline on the same machine):

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1587 (PresentX 1587)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14527 MB

PR #2167 (fa26aa785d51878afc6b95087fefd5253c0d58af):

xcl-smoke v1
commit: fa26aa785d51878afc6b95087fefd5253c0d58af
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1514 (PresentX 1514)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14524 MB

Limits of coverage

  • This PR is test-only (crates/xcl/tests/low_va.rs, 0 production-code changes); all 3 PE header and directory invariant tests passed 3/3 against the MSVC --release xcl.exe binary.
  • The 60 s retail smoke confirms non-regression of the unchanged runtime binary at this commit (single-run frame/commit delta vs. cached parent reflects normal startup variance, not this PR).

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7215428195 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2167#issuecomment-7215428195). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T10:03:46Z. --- Independent desktop NVIDIA verification of **PR #2167** at head `fa26aa785d51878afc6b95087fefd5253c0d58af` (`1` commit; exact parent & merge-base: `568e7db7729c8fa6c8f0f4b32d798faaf11462bb`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12, Wave32-only Ada), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted tests & build (`fa26aa78`) | Command | Result | | --- | --- | | `cargo build --release -p xcl` | Clean build (`0.07s` incremental `--release` build, exit `0`, `0` new warnings) | | `cargo test --release -p xcl --test low_va -- --nocapture` (3 consecutive runs) | `3 passed; 0 failed; 0 ignored; 0 filtered out` × 3 (`0.01s`, `0.01s`, `0.01s`, `0` skipped; verified `xcl_exe_is_linked_without_high_entropy_va`, `xcl_exe_is_linked_with_large_address_aware_and_cui_subsystem`, and `xcl_exe_contains_valid_tls_and_exception_directories` against the freshly built `--release` `xcl.exe`) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`568e7db7729c8fa6c8f0f4b32d798faaf11462bb`, cached baseline on the same machine): ``` xcl-smoke v1 commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1587 (PresentX 1587) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14527 MB ``` PR #2167 (`fa26aa785d51878afc6b95087fefd5253c0d58af`): ``` xcl-smoke v1 commit: fa26aa785d51878afc6b95087fefd5253c0d58af gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1514 (PresentX 1514) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14524 MB ``` ### Limits of coverage - This PR is test-only (`crates/xcl/tests/low_va.rs`, `0` production-code changes); all 3 PE header and directory invariant tests passed `3/3` against the MSVC `--release` `xcl.exe` binary. - The 60 s retail smoke confirms non-regression of the unchanged runtime binary at this commit (single-run frame/commit delta vs. cached parent reflects normal startup variance, not this PR). *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
throny commented 2026-11-29 00:47:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-29T00:47:37Z.


merge-check claim
head: fa26aa785d

<!-- greyfinch-sync:ivall/xcl:comment:7248353810 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2167#issuecomment-7248353810). Originally posted by [throny](https://github.com/throny) on 2026-11-29T00:47:37Z. --- merge-check claim head: fa26aa785d51878afc6b95087fefd5253c0d58af
throny commented 2026-11-29 01:02:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-29T01:02:09Z.


merge-check
base: fa204595
head: fa26aa785d
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2610 passed, 0 failed, 49 ignored (27 SKIPPED lines). Base alone at fa204595: 2608 passed, 0 failed, 49 ignored.
review: no blocking finding; tests only, all hunks read. The tests read only the built xcl.exe (no game binary) and are deterministic. The TLS directory they expect exists because the program registers a thread callback. Minor: a constant rewritten in a longer form and the file header reworded; machine and subsystem are checked twice. Not verified: the large-address flag on GNU-target builds some testers use.
performance: none (tests only).
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7248515343 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2167#issuecomment-7248515343). Originally posted by [throny](https://github.com/throny) on 2026-11-29T01:02:09Z. --- merge-check base: fa204595 head: fa26aa785d51878afc6b95087fefd5253c0d58af merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2610 passed, 0 failed, 49 ignored (27 SKIPPED lines). Base alone at fa204595: 2608 passed, 0 failed, 49 ignored. review: no blocking finding; tests only, all hunks read. The tests read only the built xcl.exe (no game binary) and are deterministic. The TLS directory they expect exists because the program registers a thread callback. Minor: a constant rewritten in a longer form and the file header reworded; machine and subsystem are checked twice. Not verified: the large-address flag on GNU-target builds some testers use. performance: none (tests only). verdict: safe to merge hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Parakeet-Wheat commented 2026-11-30 02:18:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Parakeet-Wheat on 2026-11-30T02:18:14Z.


merge-check claim released (we will not check head fa26aa7 now; the slot is free)

<!-- greyfinch-sync:ivall/xcl:comment:7266886843 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2167#issuecomment-7266886843). Originally posted by [Parakeet-Wheat](https://github.com/Parakeet-Wheat) on 2026-11-30T02:18:14Z. --- merge-check claim released (we will not check head fa26aa7 now; the slot is free)
relativespace2K commented 2026-11-30 02:21:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by relativespace2K on 2026-11-30T02:21:00Z.


merge-check
base: 53e85fb1
head: fa26aa785d
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2790 passed, 6 failed, 49 ignored; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (in --test gpu_two_pass_cache_e2e, so 5 failing tests give 6 failures). The same five fail on base 53e85fb1 alone (2788 passed, 6 failed, 49 ignored there), so none comes from this PR; its two new tests passed. 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused.
review: no blocking finding; tests only, crates/xcl/tests/low_va.rs, every hunk read. The added checks read xcl.exe and pin machine 0x8664, IMAGE_FILE_LARGE_ADDRESS_AWARE set, subsystem IMAGE_SUBSYSTEM_WINDOWS_CUI, a non-empty TLS directory and a non-empty exception directory, the last two through the crate's own pe::Pe parser rather than by hand, which is the right tool here. They fail loudly if a linker or profile change ever drops any of them, and HIGH_ENTROPY_VA keeping the value 0x20 (now written 0x0020) means the existing assertion still tests the same bit. One note, not blocking: the header offsets in the first test (pe + 22, optional + 68) are spelled out instead of taken from xcl::pe, so a PE layout change would break this test before the parser; the second test already covers the same fields through the parser. No duplicate: the only other low_va work is this file's existing high-entropy test.
performance: none: tests only.
verdict: safe to merge
hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.

<!-- greyfinch-sync:ivall/xcl:comment:7266928057 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2167#issuecomment-7266928057). Originally posted by [relativespace2K](https://github.com/relativespace2K) on 2026-11-30T02:21:00Z. --- merge-check base: 53e85fb1 head: fa26aa785d51878afc6b95087fefd5253c0d58af merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2790 passed, 6 failed, 49 ignored; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (in `--test gpu_two_pass_cache_e2e`, so 5 failing tests give 6 failures). The same five fail on base 53e85fb1 alone (2788 passed, 6 failed, 49 ignored there), so none comes from this PR; its two new tests passed. 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused. review: no blocking finding; tests only, `crates/xcl/tests/low_va.rs`, every hunk read. The added checks read `xcl.exe` and pin machine `0x8664`, `IMAGE_FILE_LARGE_ADDRESS_AWARE` set, subsystem `IMAGE_SUBSYSTEM_WINDOWS_CUI`, a non-empty TLS directory and a non-empty exception directory, the last two through the crate's own `pe::Pe` parser rather than by hand, which is the right tool here. They fail loudly if a linker or profile change ever drops any of them, and `HIGH_ENTROPY_VA` keeping the value `0x20` (now written `0x0020`) means the existing assertion still tests the same bit. One note, not blocking: the header offsets in the first test (`pe + 22`, `optional + 68`) are spelled out instead of taken from `xcl::pe`, so a PE layout change would break this test before the parser; the second test already covers the same fields through the parser. No duplicate: the only other `low_va` work is this file's existing high-entropy test. performance: none: tests only. verdict: safe to merge hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2157
No description provided.