HLE: decode numeric character references in manifests #2606
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!2606
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2606"
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 16:43 UTC · original
XeNS1:codex/manifest-character-references-20261125→main· +133 −7 · 1 files · 1 commits · openTitle::from_manifestrecognizes predefined XML entities but leaves numeric character references encoded. For example, XML-equivalent0012ABCDand0012ABCDcurrently produce different title IDs: the latter becomes zero. EncodedSizeMBalso becomes zero, andStoreIdretains the reference spelling.Decode decimal and hexadecimal character references alongside the existing five predefined entities, once. Accept only XML 1.0 character values; keep malformed/unknown references literal, as the existing permissive reader does. Trim the resulting field text so numeric whitespace references behave like literal whitespace. No dependencies added.
Claim: decode numeric XML character references in manifest fields. #1196 changes self-closing element ownership in the same function; this does not implement that fix. #337's quota-overflow fix is also outside this scope.
Validation on Linux x86-64, Rust 1.100.0:
crates/victory-hle/src/runtime.rsmodule can compile standalone on Linux using only std.rustc --edition=2024 --test crates/victory-hle/src/runtime.rs -o /tmp/victory-runtime-tests, then/tmp/victory-runtime-tests --test-threads=2: 7 passed. All 3 existing tests pass. Four new tests cover equivalent manifest fields, one-pass decoding, 21 malformed/unknown cases, and 9 XML character-range boundaries in both decimal and hex form.clippy-driver --edition=2024 --test crates/victory-hle/src/runtime.rs -D warnings -o /tmp/victory-runtime-clippy-testspasses; its 7 tests pass too.rustfmt --edition=2024 --check crates/victory-hle/src/runtime.rs,git diff --check, and asset policy (184 repository files / 1 staged file) pass.The full HLE crate/workspace and the pinned Rust 1.98.1 toolchain were not run locally; repository Windows CI is the integration check. All new manifests are source-written synthetic strings. No game files were accessed, included or executed.
Reference: XML 1.0 Char and CharRef productions.
AI-assisted implementation and validation: OpenAI Codex.
@kotekompotek on GitHub · 2026-11-25 17:43 UTC · original
Reviewed:
reference()decodes the five predefined entities plus&#N;/&#xN;and correctly excludes NUL/controls/surrogates/U+FFFE/U+FFFF per XML's Char production.decode_referencesis genuinely single-pass — a decoded&in the output is not re-expanded. CI green.@Marvisak on GitHub · 2026-11-25 23:19 UTC · original
Automated triage for the maintainers.
This replaces the five-entity
replacefold inelements(crates/victory-hle/src/runtime.rs) with a single-passdecode_referencesthat also decodes decimal/hex character references, restricted to XML 1.0's Char range, leaving malformed or unknown references literal. I checked that decoding is genuinely one pass (a decoded&is not re-expanded), that only lowercasexis accepted as XML requires, and that the existing comment-skipping infield_textstill composes with it; the new tests cover equivalence with plain text, single-pass behaviour, malformed references and range boundaries. CI:checkpassing.This is a recommendation for a maintainer to look, not an approval.
Generated by Claude Code
@futurepro62 on GitHub · 2026-11-26 01:29 UTC · original
Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head
e2201b0(on its base67e8ae1).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.numeric_references_preserve_manifest_fields,manifest_references_are_decoded_once,invalid_manifest_references_stay_literal,xml_character_reference_boundaries.--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
@fuzeofficlal on GitHub · 2026-11-26 16:12 UTC · original · approved these changes
Reviewed
e2201b0449ee3f04f551c0680bfc858f742adf9e(merged cleanly onto63bcca43c6a00a758510398fa43096ce7e4f7df0) and verified on Windows 11 x64 (rustc 1.98.1MSVC).Audit
crates/victory-hle/src/runtime.rs:142,:178,:231:referencedecodes the five predefined XML entities and XML 1.0 decimal/lowercase-hex numeric character references (&#...;/&#x...;), rejecting uppercase&#X, signs (+/-), empty digits,u32overflow, NUL, disallowed control characters, surrogates (0xD800..=0xDFFF),U+FFFE/U+FFFF, and out-of-range code points per XML 1.0Char.decode_referencesis strictly single-pass (split('&')+split_once(';')appending straight toout), so decoded references such as<orAare never re-expanded, malformed/unterminated references stay literal, and.trim()after decoding normalizes whitespace references like /	/ .Verification
63bcca43c6a00a758510398fa43096ce7e4f7df0+cargo run -p xtask -- policy(191 files ok)cargo clippy -p victory-hle --all-targets -- -D warnings(default &--all-features)cargo test -p victory-hle --lib -- runtime::: 8/8 passed (including all four new manifest reference tests).A,B), consecutive ampersands and extra semicolons (&&,a&b<c,A;), double-decode traps (&#65;,&lt;,&#x41;), all 29 disallowed XML 1.0 control code points, surrogates, and noncharacters.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.