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

Open
github-bot wants to merge 1 commit from github-bot/gh-1196 into main AGit
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 16:23 UTC · original
geiyiliyabumo:test/hle-runtime-d3d12x → main · +208 −8 · 2 files · 1 commits · open

Summary

Closes #1028

Full verification details and change notes are documented in #1028 (commit a4a94d7, based on main ffe310e).

 crates/victory-hle/src/modules/d3d12x.rs | 102 +++++++++++++++++++-
 crates/victory-hle/src/runtime.rs        | 161 ++++++++++++++++++++++++++++++-
 2 files changed, 255 insertions(+), 8 deletions(-)

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check on edited files: PASS
  • cargo xtask policy: PASS (zero game files/data)
  • cargo clippy --all-targets --locked -- -D warnings (default + --features diagnostics where applicable): PASS
  • Targeted & crate unit/GPU tests: PASS

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

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 16:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/1196) `geiyiliyabumo:test/hle-runtime-d3d12x` → `main` · +208 −8 · 2 files · 1 commits · open ### Summary Closes #1028 Full verification details and change notes are documented in #1028 (commit `a4a94d7`, based on `main` `ffe310e`). ```text crates/victory-hle/src/modules/d3d12x.rs | 102 +++++++++++++++++++- crates/victory-hle/src/runtime.rs | 161 ++++++++++++++++++++++++++++++- 2 files changed, 255 insertions(+), 8 deletions(-) ``` ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check` on edited files: **PASS** - `cargo xtask policy`: **PASS** (zero game files/data) - `cargo clippy --all-targets --locked -- -D warnings` (default + `--features diagnostics` where applicable): **PASS** - Targeted & crate unit/GPU tests: **PASS** *AI-assisted; synthetic tests only, no game files.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:23:16 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 18:00 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at a4a94d7: cargo test -p victory-hle passes, 113 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 18:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/1196#issuecomment-7140018459) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at a4a94d7: `cargo test -p victory-hle` passes, 113 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:18 UTC · original · edited 2026-11-25 07:21 UTC

Automated triage for the maintainers.

Merge candidate. Update after your changes: both tests I asked about are gone. device_creation_rejects_null_arguments no longer installs process-wide hooks in the test binary, and exports_are_the_console_entry_points has been removed. What remains is the fix in elements() (crates/victory-hle/src/runtime.rs): a self-closing element now records an empty body, so it no longer takes the parent's text that follows it. The remaining tests check real parsing behaviour: nested paths, comments/CDATA/declarations, single-pass entity decoding, unterminated markup, Title::from_manifest defaults/hex id/quota/first-wins, and the image registry. In modules/d3d12x.rs, every_export_resolves_as_hle_from_the_dll checks resolution and provenance for every export. The fix is small and rarely matters for real manifests, where text after a self-closing element is usually whitespace, but it is correct. Merges cleanly with main.

CI: passing (check).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/1196#issuecomment-7149412609) · edited 2026-11-25 07:21 UTC <!-- victory-triage v1 head=00d5c62aab1e762706ed9c806070f99523f274b1 verdict=merge-candidate at=2026-11-25T07:21:40Z --> Automated triage for the maintainers. **Merge candidate.** Update after your changes: both tests I asked about are gone. `device_creation_rejects_null_arguments` no longer installs process-wide hooks in the test binary, and `exports_are_the_console_entry_points` has been removed. What remains is the fix in `elements()` (`crates/victory-hle/src/runtime.rs`): a self-closing element now records an empty body, so it no longer takes the parent's text that follows it. The remaining tests check real parsing behaviour: nested paths, comments/CDATA/declarations, single-pass entity decoding, unterminated markup, `Title::from_manifest` defaults/hex id/quota/first-wins, and the image registry. In `modules/d3d12x.rs`, `every_export_resolves_as_hle_from_the_dll` checks resolution and provenance for every export. The fix is small and rarely matters for real manifests, where text after a self-closing element is usually whitespace, but it is correct. Merges cleanly with `main`. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-25 02:10 UTC · original

Rebased cleanly onto \main\ (\ccfb029), preserving inline-comment XML handling alongside the self-closing element body fix. \cargo test -p victory-hle --locked runtime::tests, \cargo clippy -p victory-hle --all-targets --locked -- -D warnings, and \cargo xtask policy\ all pass.

**@⁠geiyiliyabumo** on GitHub · 2026-11-25 02:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/1196#issuecomment-7150406265) Rebased cleanly onto \main\ (\ccfb029\), preserving inline-comment XML handling alongside the self-closing element body fix. \cargo test -p victory-hle --locked runtime::tests\, \cargo clippy -p victory-hle --all-targets --locked -- -D warnings\, and \cargo xtask policy\ all pass.
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-25 03:43 UTC · original

Updated per triage feedback: dropped \device_creation_rejects_null_arguments\ (avoiding process-wide hook installation in the test binary) and \exports_are_the_console_entry_points, keeping \every_export_resolves_as_hle_from_the_dll\ and all
untime.rs\ XML tests. Rebased onto \main\ (\940d32f); \cargo test -p victory-hle --locked\ (161 passed, 0 failed), \cargo clippy -p victory-hle --all-targets --locked -- -D warnings, and \cargo xtask policy\ all pass.

**@⁠geiyiliyabumo** on GitHub · 2026-11-25 03:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/1196#issuecomment-7152175951) Updated per triage feedback: dropped \device_creation_rejects_null_arguments\ (avoiding process-wide hook installation in the test binary) and \exports_are_the_console_entry_points\, keeping \every_export_resolves_as_hle_from_the_dll\ and all \ untime.rs\ XML tests. Rebased onto \main\ (\940d32f\); \cargo test -p victory-hle --locked\ (161 passed, 0 failed), \cargo clippy -p victory-hle --all-targets --locked -- -D warnings\, and \cargo xtask policy\ all pass.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 01:19 UTC · original

Code review and Windows 11 verification at head 00d5c62aab1e merged cleanly onto main (63bcca43c6a0):

  • Code review (crates/victory-hle/src/runtime.rs:165-214, modules/d3d12x.rs:208-269):
    • Setting body = String::new() on self-closing tags (tag.ends_with('/')) prevents <Flag/>text from consuming following parent text and pops the tag stack cleanly.
    • Verified edge cases: quoted attributes containing > or / (tag_end tracks single/double quotes), nested identically named tags (rposition unwinds to nearest matching ancestor), truncated input (break without panic), and single-pass entity decoding (&amp; last so &amp;lt; decodes once to &lt;). The 3 new d3d12x.rs unit tests are pure in-memory checks.
  • Verified (Windows 11, Rust 1.98.1):
    • cargo xtask policy: 191 files ok; cargo clippy --locked -p victory-hle --tests -- -D warnings: 0 warnings
    • victory-hle -- runtime: 18/18 passed; victory-hle -- d3d12x: 4/4 passed.

LGTM.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 01:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/1196#issuecomment-7179662882) Code review and Windows 11 verification at head `00d5c62aab1e` merged cleanly onto `main` (`63bcca43c6a0`): - **Code review (`crates/victory-hle/src/runtime.rs:165-214`, `modules/d3d12x.rs:208-269`)**: - Setting `body = String::new()` on self-closing tags (`tag.ends_with('/')`) prevents `<Flag/>text` from consuming following parent text and pops the tag stack cleanly. - Verified edge cases: quoted attributes containing `>` or `/` (`tag_end` tracks single/double quotes), nested identically named tags (`rposition` unwinds to nearest matching ancestor), truncated input (`break` without panic), and single-pass entity decoding (`&amp;` last so `&amp;lt;` decodes once to `&lt;`). The 3 new `d3d12x.rs` unit tests are pure in-memory checks. - **Verified (Windows 11, Rust 1.98.1)**: - `cargo xtask policy`: `191 files ok`; `cargo clippy --locked -p victory-hle --tests -- -D warnings`: 0 warnings - `victory-hle -- runtime`: **18/18 passed**; `victory-hle -- d3d12x`: **4/4 passed**. LGTM.
Author
Owner

@⁠DenRakEiw on GitHub · 2026-11-24 16:27 UTC · original · approved these changes

Tested merged cleanly onto main (ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC):

  • cargo test -p victory-hle: 112 passed, 0 failed (plus no_dll_planting: 1 passed)
  • cargo clippy -p victory-hle --all-targets: 0 warnings
  • cargo xtask policy: ok

Clean self-closing XML element body parsing fix in runtime.rs with thorough unit tests. Approving.

AI-assisted (Gemini 4 Neon).

**@⁠DenRakEiw** on GitHub · 2026-11-24 16:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/1196#pullrequestreview-6043236221) · **approved these changes** Tested merged cleanly onto `main` (`ffe310e`) on Windows 11 x64 (Rust 1.98.1 MSVC): - `cargo test -p victory-hle`: **112 passed, 0 failed** (plus `no_dll_planting`: 1 passed) - `cargo clippy -p victory-hle --all-targets`: **0 warnings** - `cargo xtask policy`: ok Clean self-closing XML element body parsing fix in `runtime.rs` with thorough unit tests. Approving. AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 13:32 UTC · original · approved these changes

Reviewed and verified 00d5c62a merged locally onto origin/main (63bcca43) on Windows 11 x64 (Rust 1.98.1 MSVC; synthetic tests only, no game files).

Verification

  • git merge-tree against origin/main (63bcca43): clean.
  • cargo xtask policy (PR head): 182 files ok.
  • cargo clippy --locked -p victory-hle --all-targets -- -D warnings (default and --all-features, PR head and merged): 0 warnings.
  • Dev tests (merged): full cargo test --locked -p victory-hle --lib — 168 passed, 0 failed (including a_self_closing_element_owns_no_text and the 3 new d3d12x export tests).
  • Release tests (merged): cargo test --locked --release -p victory-hle --lib -- runtime::tests d3d12x::tests — 21 passed, 0 failed.
  • Additional XML edge-case check: verified quoted > and / inside self-closing attributes (<Flag a="1>2" b='x/y' />after), nested identical self-closing tags (<Dup><Dup/>inner</Dup>), and opening tags whose quoted attribute ends with / (<Open a="x/">val</Open>) all parse as expected.

Review Notes

  • Returning String::new() when closed is true in elements() (crates/victory-hle/src/runtime.rs:179-192) prevents self-closing elements from consuming subsequent parent text while keeping single-pass entity decoding (&amp; last) and quote-aware tag_end intact.
  • The added unit tests in crates/victory-hle/src/runtime.rs:320-445 and crates/victory-hle/src/modules/d3d12x.rs:116-152 are pure in-memory checks with clean coverage.

Looks good to merge.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 13:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/1196#pullrequestreview-6075005666) · **approved these changes** Reviewed and verified `00d5c62a` merged locally onto `origin/main` (`63bcca43`) on Windows 11 x64 (Rust `1.98.1` MSVC; synthetic tests only, no game files). ### Verification - `git merge-tree` against `origin/main` (`63bcca43`): clean. - `cargo xtask policy` (PR head): `182 files ok`. - `cargo clippy --locked -p victory-hle --all-targets -- -D warnings` (default and `--all-features`, PR head and merged): 0 warnings. - **Dev tests (merged):** full `cargo test --locked -p victory-hle --lib` — **168 passed, 0 failed** (including `a_self_closing_element_owns_no_text` and the 3 new `d3d12x` export tests). - **Release tests (merged):** `cargo test --locked --release -p victory-hle --lib -- runtime::tests d3d12x::tests` — **21 passed, 0 failed**. - **Additional XML edge-case check:** verified quoted `>` and `/` inside self-closing attributes (`<Flag a="1>2" b='x/y' />after`), nested identical self-closing tags (`<Dup><Dup/>inner</Dup>`), and opening tags whose quoted attribute ends with `/` (`<Open a="x/">val</Open>`) all parse as expected. ### Review Notes - Returning `String::new()` when `closed` is true in `elements()` (`crates/victory-hle/src/runtime.rs:179-192`) prevents self-closing elements from consuming subsequent parent text while keeping single-pass entity decoding (`&amp;` last) and quote-aware `tag_end` intact. - The added unit tests in `crates/victory-hle/src/runtime.rs:320-445` and `crates/victory-hle/src/modules/d3d12x.rs:116-152` are pure in-memory checks with clean coverage. Looks good to merge.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 18:09 UTC · original

#1196 and #2606 each merge cleanly into 63bcca4, but they conflict where runtime.rs reads the body of an element. 1e07f38 keeps both original commits and resolves that overlap by leaving an empty-element body empty and decoding character references in the other bodies.

I used the same synthetic manifest in all four runs. It has a self-closing element followed by text, then a title ID containing both decimal and hexadecimal character references.

Build Self-closing element body Title ID
63bcca4 following text 0
#1196 (00d5c62) on 63bcca4 empty 0
#2606 (e2201b0) on 63bcca4 following text 0x1234abcd
Combined 1e07f38 empty 0x1234abcd

The combined branch passed all 174 HLE unit tests and both integration tests on Windows. Strict HLE Clippy in both feature configurations and asset policy passed. If taking the resolution, please retain the original commits and their Git authors. If folding the resolution into another commit, please add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>. AI-assisted with Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 18:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/1196#issuecomment-7200115999) #1196 and #2606 each merge cleanly into `63bcca4`, but they conflict where `runtime.rs` reads the body of an element. [`1e07f38`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/1e07f381d886d5d5602cda075f081387088a557e) keeps both original commits and resolves that overlap by leaving an empty-element body empty and decoding character references in the other bodies. I used the same synthetic manifest in all four runs. It has a self-closing element followed by text, then a title ID containing both decimal and hexadecimal character references. | Build | Self-closing element body | Title ID | | --- | --- | --- | | `63bcca4` | `following text` | `0` | | #1196 (`00d5c62`) on `63bcca4` | empty | `0` | | #2606 (`e2201b0`) on `63bcca4` | `following text` | `0x1234abcd` | | Combined `1e07f38` | empty | `0x1234abcd` | The combined branch passed all 174 HLE unit tests and both integration tests on Windows. Strict HLE Clippy in both feature configurations and asset policy passed. If taking the resolution, please retain the original commits and their Git authors. If folding the resolution into another commit, please add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted with Codex.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1196/head:github-bot/gh-1196'
git switch 'github-bot/gh-1196'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1196'
git switch 'github-bot/gh-1196'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1196'
git switch 'github-bot/gh-1196'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1196'
git switch 'main'
git merge --squash 'github-bot/gh-1196'
git switch 'main'
git merge --ff-only 'github-bot/gh-1196'
git switch 'main'
git merge 'github-bot/gh-1196'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!1196
No description provided.