Skip to content

fix(APR): correct guest resolution outputs, object layout and gather sizing - #2789

Merged
adriadam10 merged 4 commits into
boykopovar:mainfrom
tototomate123:fix/hfw-apr-split
Oct 11, 2026
Merged

adriadam10 merged 4 commits into
boykopovar:mainfrom
tototomate123:fix/hfw-apr-split

Conversation

@tototomate123

@tototomate123 tototomate123 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

What

Split from #1616, following its review. Set guest errno, invalidate failed file IDs/sizes and return the successful ForEach count. Match the 24-byte object: type at 0, cursor at 4, count at 8, capacity at 12 and pointer at 16, as asserted by ampr_emu; its 32-bit type word is represented as two 16-bit fields.

Compact gathers use 12 rather than 40 bytes to avoid HFW's 1 MiB buffer exhaustion. Opcode 29 and the three-word packing are AnyPS5 internal encoding, not console opcodes; existing 40-bit offsets and lengths 1 through 2^32 are retained. Keep that distinction in the header comment and record the reference/limits in TechnicalDebt. Three commits.

Tested

Linux x86-64, GCC 16.2.1, Release. guest_ampr_markers passes, including guest errno/failed output handling, constrained-buffer gather execution and size/offset boundary checks. Object field offsets are asserted at compile time. Conventions and whitespace checks pass on current main (5edae353).

Depends on

None for build. HFW integration also needs #2785 (relinker), #2786 (loader), #2787 (filesystem), #2788 (http), #2790 (shader). #1269 (media), #1339 (VRR), #1586 (unwind) and #1436 (imports) are now on main. Local image-table experiments are excluded; open #757 → #758 overlaps them, and #920 is closed without merging. Earlier combined integration reached menu/loading UI; these isolated branches have not been game-tested and gameplay is unverified.

Checklist

  • Based on current main; no duplicate implementation found beyond superseded fix(linux): resolve loader and APR failures exposed by HFW #1616
  • One topic per PR
  • No code comments except technical debt
  • Unimplemented paths throw; offline HTTP limitations documented
  • No investigation notes, logs or images committed
  • No new third-party dependencies
  • Generic behavior; no title-specific dispatch
  • Depends on: none for build; HFW integration requirements listed above
  • AI-assisted: yes, Codex

@github-actions

Copy link
Copy Markdown

Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

@github-actions github-actions Bot closed this Oct 10, 2026
@oneandonlydean oneandonlydean removed the intake paused Closed while PR intake is limited to authors with at least 10 PRs merged into main label Oct 11, 2026
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on Linux (GCC, Release) with the PR rebased onto current main: guest_ampr_markers and guest_ampr_threads pass (96/96 in the scoped ctest); the new test code doesn't build without the change. The 24-byte object layout matches the ampr_emu assertions, the compact gather round-trips 40-bit offsets and lengths 1..2^32 through submit, and the errno now goes to the guest errno.

Added as our own commit: a TechnicalDebt line recording that the ForEach return value (count of resolved paths) is not confirmed on a title; ampr_emu only passes the resolver's count through.

Merging once CI is green.

@Mouhand-Kaddo

Copy link
Copy Markdown
Contributor

Additional platform validation of standalone PR head b299350a7a008cc3ce2a39c8c6140390faa1ab3e (2026-10-11):

Windows: passed — Windows 11, WinLibs GCC 15.2.0 UCRT/POSIX/SEH r7; CMake 4.3.1 / Ninja; Release, BUILD_TESTING=ON.

1 checks, 0 failures, 0 CTest skips. Built the selected targets and dependencies; this is focused validation, not a full build or full-suite run.

Checks: guest_ampr_markers.

Command after building: ctest --test-dir <build> --verbose --no-tests=error --timeout 30 -R "^guest_ampr_markers$".

No title/gameplay validation. These results cover the standalone head, not a merge with current main.

@adriadam10
adriadam10 merged commit 3db4637 into boykopovar:main Oct 11, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants