HLE: read manifest fields past inline XML comments #487

Merged
Quat3rnion merged 1 commit from upstream-pr/487 into main 2026-11-25 00:11:24 +00:00
Quat3rnion commented 2026-11-24 03:57:57 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Quat3rnion on 2026-11-24T03:57:57Z.


What

elements() read a field's text up to the next <. A manifest generator
that writes <TitleId><!-- generated -->639AA8DD</TitleId> therefore
produced an empty TitleId, giving the title id 0 and the wrong save
namespace. The same affected StoreId and storage size. Field text now skips
comments instead of stopping at them; other markup still ends the field.

An AI tool wrote part of this change.

Tested

  • Linux: cargo test --workspace: 165 passed, 0 failed, 3 ignored. The existing manifest test still passes; a new regression puts inline comments inside TitleId, StoreId and SizeMB and checks all three values.
  • Windows cross-build: cargo check --target x86_64-pc-windows-gnu --workspace --tests passes. No Windows host here.
  • cargo xtask policy passes (150 files ok). No game files or data from them were added.

Checklist

  • Workspace tests and Windows cross-check pass.
  • cargo xtask policy passes. No game files or data from them were added.
  • AI authorship is disclosed above.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6574276269 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/487). Originally posted by [Quat3rnion](https://github.com/Quat3rnion) on 2026-11-24T03:57:57Z. --- ## What `elements()` read a field's text up to the next `<`. A manifest generator that writes `<TitleId><!-- generated -->639AA8DD</TitleId>` therefore produced an empty TitleId, giving the title id 0 and the wrong save namespace. The same affected StoreId and storage size. Field text now skips comments instead of stopping at them; other markup still ends the field. An AI tool wrote part of this change. ## Tested - Linux: `cargo test --workspace`: 165 passed, 0 failed, 3 ignored. The existing manifest test still passes; a new regression puts inline comments inside TitleId, StoreId and SizeMB and checks all three values. - Windows cross-build: `cargo check --target x86_64-pc-windows-gnu --workspace --tests` passes. No Windows host here. - `cargo xtask policy` passes (150 files ok). No game files or data from them were added. ## Checklist - [x] Workspace tests and Windows cross-check pass. - [x] `cargo xtask policy` passes. No game files or data from them were added. - [x] AI authorship is disclosed above.
mercuryVM commented 2026-11-24 09:05:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T08:40:52Z.

Review: APPROVED


Tested be484a1 on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (248 passed, 0 failed; older base), including inline_comments_do_not_truncate_a_field.

field_text keeps the old rule that any other markup ends the text, and only steps over <!-- … -->. Entities are still decoded afterwards on the joined text (the 9&amp;<!-- -->C case shows that). An unterminated comment stops at the text read so far rather than swallowing the rest. It also merges cleanly with #359 (quoted > in attributes), which is in our fork: together they handle both directions of this parser's edge cases.

No issues found.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6036065626 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/487#pullrequestreview-6036065626). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T08:40:52Z. **Review:** APPROVED --- Tested be484a1 on Windows 11, RTX 5070, MSVC: `cargo test --workspace --no-fail-fast` passes (248 passed, 0 failed; older base), including `inline_comments_do_not_truncate_a_field`. `field_text` keeps the old rule that any other markup ends the text, and only steps over `<!-- … -->`. Entities are still decoded afterwards on the joined text (the `9&amp;<!-- -->C` case shows that). An unterminated comment stops at the text read so far rather than swallowing the rest. It also merges cleanly with #359 (quoted `>` in attributes), which is in our fork: together they handle both directions of this parser's edge cases. No issues found. AI-assisted (Claude Code).
jeremygold02 commented 2026-11-24 18:05:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T17:40:28Z.


Focused verification on current head ca362a42473bb0f8f9a83377091287a621e94527:

cargo test --locked -p victory-hle --lib inline_comments_do_not_truncate_a_field -- --test-threads=1 passed (1 passed, 0 failed). This exercises manifest parsing through Title::from_manifest: inline comments are skipped before TitleId and storage size values, and 9&amp;<!-- keep -->C becomes 9&C. The earlier review cites a workspace run on be484a1; this result is specifically for the current SHA above.

This verification was AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7139539303 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/487#issuecomment-7139539303). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-24T17:40:28Z. --- Focused verification on current head `ca362a42473bb0f8f9a83377091287a621e94527`: `cargo test --locked -p victory-hle --lib inline_comments_do_not_truncate_a_field -- --test-threads=1` passed (`1 passed, 0 failed`). This exercises manifest parsing through `Title::from_manifest`: inline comments are skipped before `TitleId` and storage size values, and `9&amp;<!-- keep -->C` becomes `9&C`. The earlier review cites a workspace run on `be484a1`; this result is specifically for the current SHA above. This verification was AI-assisted.
upstream-sync closed this pull request 2026-11-25 01:03:57 +00:00
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
Marvisak/VIctory!487
No description provided.