HLE: fix self-closing XML element body parsing in runtime.rs and add unit tests #1028

Open
opened 2026-11-26 04:17:36 +00:00 by github-bot · 2 comments
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 15:11 UTC · original

Summary

Fixes a manifest XML parsing bug in crates/victory-hle/src/runtime.rs and expands deterministic synthetic unit tests across runtime.rs (1 -> 15 tests) and crates/victory-hle/src/modules/d3d12x.rs (1 -> 6 tests).

Because external PR creation is currently restricted (collaborators_only), the CI-green branch is ready on my fork for cherry-pick / review:

  • Branch: geiyiliyabumo/VIctory@test/hle-runtime-d3d12x
  • Commit: geiyiliyabumo/VIctory@a4a94d7 (based on main ffe310e)

Changes

  • crates/victory-hle/src/runtime.rs:
    • Bug fix: the manifest XML elements parser previously attributed trailing text after a self-closing element (<Flag/>text) to that element; it now records an empty body as documented.
    • Added 14 unit tests (15 total): nested paths, self-closing ownership, comments/CDATA/declarations skipped, single-pass entity decoding, unterminated markup, missing/invalid fields, lowercase hex IDs, store-ID trim+decode, saves(), and image registry lifecycle.
  • crates/victory-hle/src/modules/d3d12x.rs:
    • Added 5 unit tests (6 total): IID data binding, case-insensitive d3d12_xs.dll serving, export set + Provenance::Hle resolution, device::IID export pointer, and D3D12XboxCreateDevice null-arg E_INVALIDARG rejection.

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check: PASS
  • cargo xtask policy: PASS (154 files ok)
  • cargo clippy -p victory-hle --all-targets --locked -- -D warnings (default + --features diagnostics): PASS (0 warnings)
  • cargo test -p victory-hle --locked -- runtime:: (15/15 PASS) & -- d3d12x:: (6/6 PASS)

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 15:11 UTC · [original](https://github.com/Marvisak/VIctory/issues/1028) ### Summary Fixes a manifest XML parsing bug in `crates/victory-hle/src/runtime.rs` and expands deterministic synthetic unit tests across `runtime.rs` (1 -> 15 tests) and `crates/victory-hle/src/modules/d3d12x.rs` (1 -> 6 tests). Because external PR creation is currently restricted (`collaborators_only`), the CI-green branch is ready on my fork for cherry-pick / review: - **Branch**: `geiyiliyabumo/VIctory@test/hle-runtime-d3d12x` - **Commit**: `geiyiliyabumo/VIctory@a4a94d7` (based on `main` `ffe310e`) ### Changes - **`crates/victory-hle/src/runtime.rs`**: - **Bug fix**: the manifest XML `elements` parser previously attributed trailing text after a self-closing element (`<Flag/>text`) to that element; it now records an empty body as documented. - Added 14 unit tests (15 total): nested paths, self-closing ownership, comments/CDATA/declarations skipped, single-pass entity decoding, unterminated markup, missing/invalid fields, lowercase hex IDs, store-ID trim+decode, `saves()`, and image registry lifecycle. - **`crates/victory-hle/src/modules/d3d12x.rs`**: - Added 5 unit tests (6 total): IID data binding, case-insensitive `d3d12_xs.dll` serving, export set + `Provenance::Hle` resolution, `device::IID` export pointer, and `D3D12XboxCreateDevice` null-arg `E_INVALIDARG` rejection. ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check`: **PASS** - `cargo xtask policy`: **PASS** (`154 files ok`) - `cargo clippy -p victory-hle --all-targets --locked -- -D warnings` (default + `--features diagnostics`): **PASS** (0 warnings) - `cargo test -p victory-hle --locked -- runtime::` (**15/15 PASS**) & `-- d3d12x::` (**6/6 PASS**) *AI-assisted; synthetic tests only, no game files.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:17:36 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 06:52 UTC · original · edited 2026-11-25 09:57 UTC

Automated triage for the maintainers.

Confirmed on current main (940d32f): in crates/victory-hle/src/runtime.rs, elements takes field_text(rest) as the body of every element, including a self-closing one (closed). So the text after <Flag/> is recorded as that element's body before the path is popped. The fix and the added runtime.rs / d3d12x.rs tests are now open as PR #1196, so review can continue there; it may need a rebase onto current main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 06:52 UTC · [original](https://github.com/Marvisak/VIctory/issues/1028#issuecomment-7155242234) · edited 2026-11-25 09:57 UTC <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-25T09:09:27Z at=2026-11-25T09:50:38Z --> Automated triage for the maintainers. Confirmed on current `main` (940d32f): in `crates/victory-hle/src/runtime.rs`, `elements` takes `field_text(rest)` as the body of every element, including a self-closing one (`closed`). So the text after `<Flag/>` is recorded as that element's body before the path is popped. The fix and the added `runtime.rs` / `d3d12x.rs` tests are now open as PR #1196, so review can continue there; it may need a rebase onto current `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠StExpeditus on GitHub · 2026-11-25 09:09 UTC · original

Validated the fork branch on Windows 11 Pro 26200 (Intel Core i5-14600K, Rust 1.98.1 MSVC), commit 00d5c62: cargo test -p victory-hle --locked --no-fail-fast -> 162 passed, 0 failed, 0 ignored. Synthetic tests only, no game files.

**@⁠StExpeditus** on GitHub · 2026-11-25 09:09 UTC · [original](https://github.com/Marvisak/VIctory/issues/1028#issuecomment-7157950468) Validated the fork branch on Windows 11 Pro 26200 (Intel Core i5-14600K, Rust 1.98.1 MSVC), commit `00d5c62`: `cargo test -p victory-hle --locked --no-fail-fast` -> **162 passed, 0 failed, 0 ignored**. Synthetic tests only, no game files.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#1028
No description provided.