HLE: fix self-closing XML element body parsing in runtime.rs and add unit tests #1196
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!1196
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1196"
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?
@geiyiliyabumo on GitHub · 2026-11-24 16:23 UTC · original
geiyiliyabumo:test/hle-runtime-d3d12x→main· +208 −8 · 2 files · 1 commits · openSummary
Closes #1028
Full verification details and change notes are documented in #1028 (commit
a4a94d7, based onmainffe310e).Verification (Windows 11 x64 MSVC)
rustfmt --edition 2024 --checkon edited files: PASScargo xtask policy: PASS (zero game files/data)cargo clippy --all-targets --locked -- -D warnings(default +--features diagnosticswhere applicable): PASSAI-assisted; synthetic tests only, no game files.
@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-hlepasses, 113 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
@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_argumentsno longer installs process-wide hooks in the test binary, andexports_are_the_console_entry_pointshas been removed. What remains is the fix inelements()(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_manifestdefaults/hex id/quota/first-wins, and the image registry. Inmodules/d3d12x.rs,every_export_resolves_as_hle_from_the_dllchecks 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 withmain.CI: passing (
check).Generated by Claude Code
@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 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.@fuzeofficlal on GitHub · 2026-11-26 01:19 UTC · original
Code review and Windows 11 verification at head
00d5c62aab1emerged cleanly ontomain(63bcca43c6a0):crates/victory-hle/src/runtime.rs:165-214,modules/d3d12x.rs:208-269):body = String::new()on self-closing tags (tag.ends_with('/')) prevents<Flag/>textfrom consuming following parent text and pops the tag stack cleanly.>or/(tag_endtracks single/double quotes), nested identically named tags (rpositionunwinds to nearest matching ancestor), truncated input (breakwithout panic), and single-pass entity decoding (&last so&lt;decodes once to<). The 3 newd3d12x.rsunit tests are pure in-memory checks.cargo xtask policy:191 files ok;cargo clippy --locked -p victory-hle --tests -- -D warnings: 0 warningsvictory-hle -- runtime: 18/18 passed;victory-hle -- d3d12x: 4/4 passed.LGTM.
@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 (plusno_dll_planting: 1 passed)cargo clippy -p victory-hle --all-targets: 0 warningscargo xtask policy: okClean self-closing XML element body parsing fix in
runtime.rswith thorough unit tests. Approving.AI-assisted (Gemini 4 Neon).
@fuzeofficlal on GitHub · 2026-11-26 13:32 UTC · original · approved these changes
Reviewed and verified
00d5c62amerged locally ontoorigin/main(63bcca43) on Windows 11 x64 (Rust1.98.1MSVC; synthetic tests only, no game files).Verification
git merge-treeagainstorigin/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.cargo test --locked -p victory-hle --lib— 168 passed, 0 failed (includinga_self_closing_element_owns_no_textand the 3 newd3d12xexport tests).cargo test --locked --release -p victory-hle --lib -- runtime::tests d3d12x::tests— 21 passed, 0 failed.>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
String::new()whenclosedis true inelements()(crates/victory-hle/src/runtime.rs:179-192) prevents self-closing elements from consuming subsequent parent text while keeping single-pass entity decoding (&last) and quote-awaretag_endintact.crates/victory-hle/src/runtime.rs:320-445andcrates/victory-hle/src/modules/d3d12x.rs:116-152are pure in-memory checks with clean coverage.Looks good to merge.
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 18:09 UTC · original
#1196 and #2606 each merge cleanly into
63bcca4, but they conflict whereruntime.rsreads the body of an element.1e07f38keeps 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.
63bcca4following text000d5c62) on63bcca40e2201b0) on63bcca4following text0x1234abcd1e07f380x1234abcdThe 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.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.