Skip to content

Add adaptive 60 fps support for Pokémon Legends: Z-A 2.0.2 - #918

Open
thehobbit85 wants to merge 1 commit into
seedds:mainfrom
thehobbit85:codex/za-dynamic-60fps
Open

thehobbit85 wants to merge 1 commit into
seedds:mainfrom
thehobbit85:codex/za-dynamic-60fps

Conversation

@thehobbit85

@thehobbit85 thehobbit85 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Pokémon Legends: Z-A 2.0.2 uses its verified native-clock hook to follow the host's adaptive whole-vsync frame step. The fixed-address hook remains restricted to the verified main build; setting fps_target 60 alone does not provide this behavior.

Head eb0030f1a6e8924cb4d86e1fc7a27cd34126d482 resolves the shared profile-documentation conflict on main d43d4355865c130759f26727c5aeaf37c7be79d5. Main's engine/frame-step documentation and newer host/renderer changes are preserved. The Z-A executable hook, game profile, smoke/benchmark routes and hook-specific test source are byte-identical to the previous published head. The rewriter's only feature delta remains its supported-title comment.

Fresh local validation on native arm64 macOS, Xcode 27.2 / supported Metal 32023.922.4 and Python 3.14:

  • make -C dm/host GAME=0100F43008C44000 -j3: full host build passed.
  • make -C dm/gfx/tests GAME=0100F43008C44000 -j2 check_t_fstep: 119 checks passed, zero failures.
  • python -m unittest -v dm.tools.tests.test_za_fps dm.tools.tests.test_patches dm.tools.tests.test_game_profile dm.tools.tests.test_docs: 48 ran, 47 passed, one inherited failure, zero skips. All five ARM64 execution cases passed using isolated Unicorn 2.1.4, including native 30/60 timing, variable steps, startup and disabled/register preservation. The initial environment lacked Unicorn; the completed run used the optional dependency with native JIT access.
  • The failure is Registry.test_entry_forms: Strikers' unchanged profile exports _FULL_RATE, _RATE, _STEP and _FLOAT_RATE, which main's registry rejects. The same failure was independently reproduced on exact main; no assertion or profile workaround was added here.
  • Range/main diff, main ancestry, generated documentation and whitespace checked. Main also has 22 new Python lint diagnostics at unchanged scripts/build_ipa_from_nsp.py:1765, independently reproduced. These shared failures remain for CI remediation; current-head remote CI is unverified.

Impacted game: Z-A 2.0.2 only, because the hook is build-gated. The native fixture validates host frame-step behavior, not gameplay. No game was launched, extracted or packaged; no fresh shader comparison, controlled performance, full graphics suite or device result is claimed. The historical p99 regression 37.6 → 52.3 ms (+39.1%) remains unresolved. Sustained 60 fps, audio synchronization, battles, longer routes and iPhone behavior remain unverified. Earlier results and original commit rationale below remain historical.

Historical published description, original commit context and validation

Current integration — November 13, 2026

Published commit 448e17f8a95fb53601b129d3cbe11f674523eaee rebases 4fdcf174bfc51f1e114ec2a4034b2c6a3d74abdb onto main 90b7cefd1d572ab05859c73930b436c4040cd25c. The verified Z-A 2.0.2 adaptive native-clock hook remains distinct from main: fps_target 60 alone cannot make Trinity's clock follow the host's whole-vsync step. Other main builds receive no fixed-address hook. Main's newer frame-pacing fallback and all host/renderer changes are preserved; only the shared profile documentation conflicted. The hook, profile, routes and hook-specific regression tests are unchanged from the published feature.

Validation (native Python 3.14.6, Xcode 27.2, Apple Metal 32023.922.4): the 90-case hook/profile suite and native builds below ran on 8ba38081bf6649ec244380a220b918eee564ada3 / main 48dca7a4ad146afc05a01cbd200387d8854ebea7. All host, NVN, texture, MSL, native fixture, profile and hook/rewrite inputs are byte-identical on this final revision; fresh documentation/chain and lint checks cover the later shader-extraction and PRAGMATA changes.

  • python3 -m unittest -v dm.tools.tests.test_za_fps dm.tools.tests.test_patches dm.tools.tests.test_fps_target dm.tools.tests.test_game_profile dm.tools.tests.test_docs dm.tools.tests.test_settings dm.tools.tests.test_ue_fixed_rate dm.tools.tests.test_nso_match: 90 cases, no failures/errors; five optional Unicorn ARM64 execution cases skipped because that dependency is unavailable. The build-gate/patch registry and frame-state layout tests ran.
  • On the final candidate, python3 -m unittest -v dm.tools.tests.test_docs dm.tools.tests.test_nsp_chain: 23 cases passed. Patch index and symptom generators report current output; chain/source/lock are exactly main.
  • make -C dm/host GAME=0100F43008C44000 -j3: passed, including final main's tessellation renderer integration. make -C dm/gfx/tests GAME=0100F43008C44000 -j1 check_t_timestamp check_t_counter_clock check_t_fstep: 25 timestamp + 21 counter-clock + 86 adaptive-step checks passed. make -C dm/host/tests GAME=0100F43008C44000 build/t_fpslock and its executable passed. The shared frame-step and engine-cap inputs are unchanged; the timestamp replay fixture was rebuilt with the newer renderer.
  • Pinned Ruff 0.17.2 / Pyright 1.1.414 via dm/tools/lint_python.py: 321 findings against 321 baseline entries, zero new or stale; baseline unchanged.

Impacted game: Pokémon Legends: Z-A 2.0.2 only, because the new native-clock hook is keyed to its verified main build. No game was launched, extracted or packaged for this refresh, and no current gameplay, shader-library comparison, controlled performance or full native graphics result is claimed. The shared frame-step and engine-cap native fixtures check host behavior, not Z-A gameplay. The historical p99 increase 37.6 → 52.3 ms (+39.1%) remains unresolved; sustained 60 fps, audio synchronization, battles, longer routes and iPhone behavior remain unverified. Current-head remote CI is pending verification.

Original commit context (historical)
Add adaptive 60 fps support for Pokemon Legends Z-A 2.0.2

Register the verified frame-step hook and profile choices, with build-gated rewrite coverage and normal-speed timing tests. Preserve the unresolved frame-time regression and incomplete runtime coverage in the durable game findings.
Previous description and validation history (historical; preserved verbatim)

Current refresh — November 9, 2026

Rebased 4fdcf174bfc51f1e114ec2a4034b2c6a3d74abdb onto main bbea4c90f136f478e25228bc3d4ab33c77420f2e. Main's text-only README and removal of the old gallery are preserved; the full games table and Z-A frame-rate note retain the option. The generated game-patch index was rebuilt from combined sources. The adaptive hook, profile, benchmark/smoke inputs and ARM64 fixture are byte-identical to the previous published head.

Removed the redundant patch-area reservation from this PR: main now supplies the required adjustment for registered and matched frame steps. The retained layout regression exercises that upstream implementation; the rewriter's only remaining PR delta is its supported-title comment. The Z-A hook remains build-bound to 2.0.2, and no unverified function matching was added.

Fresh validation on this head: 70 focused tests ran, 65 passed and five optional Unicorn execution tests were skipped. The Mac host build passed with 56 compiler warnings, and native frame-step and frame-rate cap fixtures passed. The pinned Python ratchet reproduces exact main's three dmsh_build.py:166–167 findings (339 total, 336 baseline, zero stale); it is not clean. No baseline or assertion was weakened. Main ancestry, feature preservation and final diff were reviewed. Replacement-head remote CI is pending the CI handoff.

No fresh gameplay, game extraction, shader rebuild, performance comparison or device validation was performed. In particular, the historical target-30 p99 regression 37.6 → 52.3 ms (+39.1%) remains unresolved; this pass does not establish sustained 60 fps or current runtime qualification. Other historical limits and original commit context below remain in force.

Historical revision records

All remaining revision-specific runs below predate this refresh.

The Z-A 2.0.2 adaptive frame-step hook and profile choices remain absent from main. The earlier frame-time regression still requires independent verification before merge.

Conflict refresh — 2026-11-09 UTC

Rebased a18b7ab5bbd0a93f840ba4a0a782b60a71c76818 onto main 7479adf86cd7997c806d45c4c99a875ed4a6038e as fcfb076bcce43a33c532ab1d47640f91651c9e40. Main advanced by two shader-tool commits and then a Unity decoder lint correction before publication; the live PR still conflicted, and its feature patch remained equivalent after incorporating them. The gallery uses main's exact table with only the existing Z-A 2.0.2 caption added; regeneration preserves main's newer Brilliant Diamond caption and every game exactly once. The patch catalogue retains current main's function-matched hooks. The Z-A binding note now states its actual remaining limitation: this clock adapter has not been validated for function matching across builds. Its executable hook and build gate are unchanged.

The shared state-page reservation still covers both registered and function-matched frame steps before branch emission. Range-diff confirms unchanged feature patches except the binding explanation and generated-document context. All 174 upstream-only paths match main; six of seven feature-only paths match the old head exactly, and the seventh differs only in that binding explanation. Main is an ancestor, and the generated files and remaining diff were reviewed.

Fresh validation and limitations

On Apple Silicon, macOS 26.6, Xcode 27.2 and native Python 3.14.6:

  • /opt/homebrew/bin/python3 -m unittest dm.tools.tests.test_za_fps dm.tools.tests.test_patches dm.tools.tests.test_fps_target dm.tools.tests.test_game_profile dm.tools.tests.test_docs dm.tools.tests.test_settings dm.tools.tests.test_ue_fixed_rate dm.tools.tests.test_nso_match dm.tools.tests.test_shader_package_keys dm.tools.tests.test_unity_bucket: 99 tests on the exact final head, 94 passed and five optional Unicorn ARM64 execution cases skipped. Historical executed-hook results below remain attributed to their original revisions.

  • arch -arm64 make -C dm/host GAME=0100F43008C44000 -j4 linked successfully on bcc357a30a7efc0792959841208d732198beef64, with host/graphics sources and dependencies byte-identical to the final head, with 58 existing compiler warnings. An initial invocation inherited an x86-translated launcher and failed on ARM64 instructions; selecting native ARM64 corrected the invocation without a source change. Native t_fpslock and all 78 t_fstep checks passed on the intermediate 42b44e47767f5b409c81a8ee52082d744c46fba8; their source and dependencies are unchanged by the final two upstream commits.

  • The workflow-pinned Ruff 0.17.2 / Pyright 1.1.414 ratchet passes on the final head: 336 findings against 336 baseline entries, zero new or stale findings. Earlier candidates reproduced three optional-subscript findings in main’s Unity decoder. Upstream 7479adf8 fixes their cause by reusing checked instruction decodes; it is now included. No local workaround or baseline change was added.

  • Gallery, patch-catalogue and symptom generation, documentation checks and git diff --check passed. No agent artifacts are included. Remote CI on this replacement head remains pending Agent 3's verification.

Z-A 2.0.2 is the direct target; the shared state-page guard also reaches matched frame steps such as Ocarina of Time and Mario Kart World. Hades, Breath of the Wild, Pokémon Scarlet and Tears of the Kingdom are additional shared-rewriter impact targets. No game, station benchmark, extraction, shader translation, full graphics campaign or device test ran in this refresh. The earlier busy-run p99 increase from 37.6 to 52.3 ms (+39.1%), two qualified main trials and zero qualified candidate trials remain unresolved. Sustained 60 fps, controlled stalls, audio, iOS and full-game coverage remain open. Other Z-A builds do not acquire this fixed-address hook automatically.

Historical proposal, validation and original commit context

The previous description follows intact. Its results and earlier current-state wording apply to the revisions they record; current main now supports function-matched frame steps, but this particular clock adapter remains build-gated.

The Z-A 2.0.2 adaptive frame-step hook and profile choices remain absent from main.

Conflict refresh — 2026-11-08 UTC

Rebased 7f71a20f6d0a75456c87798847533ea43d9ae877 onto 555122a9069235441d5a88955105397ec6d53686 as a18b7ab5bbd0a93f840ba4a0a782b60a71c76818. Regenerating the patch catalogue retains the existing Z-A hook and main's new function-matched Ocarina of Time and Mario Kart World stubs. Main selects a function match before layout and uses the same state page for a match or a registered build. The layout guard now reserves that page for either path. An added boundary test reproduced the overlap before the guard covered matches and passed after the fix. Misses, SDK modules and front patch layouts retain their offsets.

On this exact head, 124 of 129 focused Python tests passed and five optional ARM64 Unicorn cases skipped. Coverage includes the Z-A hook, function matcher, profile and rewriter boundaries, fixed-rate behavior and generated documentation. The native frame-lock fixture for Z-A and all 78 frame-step checks passed. Pinned Ruff 0.17.2 and Pyright 1.1.414 reported 376 findings against 371 recorded. The five excess counts are three reportIndexIssue and two reportArgumentType findings on unchanged main registry test lines. Removing only the added layout fixture reconstructs the main test file byte-for-byte, with no finding in the added lines. This is an inherited lint failure. Range-diff, ancestry, generated documentation and git diff --check were verified. Remote CI remains pending.

Z-A 2.0.2 is the direct target. The matched layout change can also affect Ocarina of Time and Mario Kart World. The broader shared-rewriter impact rule identifies Hades, Breath of the Wild, Pokémon Scarlet and Tears of the Kingdom, with 149 profiles of unknown coverage. This refresh adds no game run, benchmark, device test, shader translation or extraction. The earlier busy-run p99 increase from 37.6 to 52.3 ms (+39.1%) remains unresolved. Two qualified main runs and zero qualified candidate runs leave sustained 60 fps, stall, audio, iOS and full-game coverage open.

Historical proposal, validation and original commit context

The complete prior description follows. Its earlier results belong to the revisions they record.

The Z-A 2.0.2 adaptive frame-step hook and profile choices remain absent from main.

Current conflict refresh — 2026-11-07 19:04 UTC pass

Rebased 96d395490d8f312d2f79ea09bffbade83edcd35d onto main bd979ced3ae6bad60bf86429a71d172297d93471, producing 7f71a20f6d0a75456c87798847533ea43d9ae877 on the same PR branch. The conflict was the fps_target documentation row: it now retains main's Unreal bUseFixedFrameRate/Pikmin 4 behavior and the Z-A entry. Generated gallery, patch catalogue and symptom index are current. Range-diff and the remaining main diff were reviewed. All nine feature-only paths and fourteen upstream-only paths are byte-identical to their respective inputs; the combined rewriter is exactly current main plus the existing feature's two additions. Main is an ancestor of the tested head.

Fresh validation on this exact head, using an Apple M2 Max, macOS 26.6, Xcode 27.2 and native Python 3.14.6:

  • /opt/homebrew/bin/python3 -m unittest dm.tools.tests.test_za_fps dm.tools.tests.test_patches dm.tools.tests.test_fps_target dm.tools.tests.test_game_profile dm.tools.tests.test_docs dm.tools.tests.test_settings dm.tools.tests.test_ue_fixed_rate: 57 tests, 52 passed and five optional ARM64 execution cases skipped because Unicorn is unavailable.
  • make -C dm/host GAME=0100F43008C44000 -j6: native host build passed. It emitted 57 compiler warnings in unchanged upstream sources; this is not a zero-warning claim.
  • Native t_fpslock, rebuilt for GAME=0100F43008C44000, passed the frame-limit cases including main's new Unreal flag handling. The freshly built t_fstep passed all 78 checks.
  • /Users/thehobbit85/Games/venv/bin/python3 dm/tools/lint_python.py, using the workflow-pinned Ruff 0.17.2 / Pyright 1.1.414: 371 findings against 371 baseline entries, zero new or stale findings. An initial system-Python invocation lacked Ruff; the existing pinned environment supplied the successful run. No source or baseline was changed for lint.
  • Generated documentation, git diff --check, feature preservation and PR documentation/artifact placement checks passed. Remote CI on this replacement commit is pending Agent 3's verification; older results do not validate it.

Z-A 2.0.2 is the direct target. scripts/regress.py impact bd979ced3ae6bad60bf86429a71d172297d93471..HEAD also identifies Hades, Breath of the Wild, Pokémon Scarlet and Tears of the Kingdom through the broad shared-rewriter rule; 147 profiles lack usage manifests. These games have no fresh end-to-end result from this documentation conflict refresh. No gameplay, benchmark, shader translation, extract rebuild or device run was performed. Prior unavailable-build/cold-cache limits below remain historical evidence, not a fresh regression pass. The earlier busy-run p99 increase from 37.6 to 52.3 ms (+39.1%) remains unresolved. Two qualified main runs and zero qualified candidate runs leave sustained 60 fps, stalls, audio, iOS and full-game coverage open.

Earlier proposal, validation and original commit context

The previous description follows in full; its earlier current/refresh sections apply only to the revisions they record.

The Z-A 2.0.2 adaptive frame-step hook and profile choices remain absent from main.

Conflict refresh — 2026-11-07

Rebased 9de1409fe7122ca6864ceb1673eaab58ba8b4c0f onto main 01abf27977aa4a7366c4a14bc58d9eae75f1d8e6 as 96d395490d8f312d2f79ea09bffbade83edcd35d. The profile key table retains main's newer frame-limit descriptions and the Z-A entry. The game-patch catalogue, gallery and symptom index were regenerated from the combined sources. Range-diff shows that the feature changes outside the affected documentation retain their prior patch content.

On this head, 87 of 92 focused Python checks passed and five optional Unicorn cases skipped. The native frame-lock fixture and all 78 frame-step checks passed. The pinned Python ratchet matched 371 baseline findings with zero new or stale findings. The generated documentation and remaining diff passed checks.

The affected game is Z-A 2.0.2. Its hook is gated to the verified build, and the frame-state boundary fixture also checks the shared rewriter path. This refresh had no matching runnable game build and adds no gameplay, device, shader translation or benchmark result. The earlier busy-run p99 increase from 37.6 to 52.3 ms (+39.1%) remains unresolved. Two qualified main runs and zero qualified candidate runs leave sustained 60 fps, stalls, audio, iOS and full-game coverage open.

Historical proposal, validation and original commit context

The previous description follows in full. Its earlier results apply to the revisions it records.

The build-gated Z-A 2.0.2 adaptive frame-step hook, profile choices and frame-state layout correction remain absent from main.

Current conflict refresh — 2026-11-06

Rebased 725722f5bd80ccda455cf085684586627438f6bd onto pinned main b2d46b86d03f4b03afe11ea61c67cdf00d7a5345, producing 9de1409fe7122ca6864ceb1673eaab58ba8b4c0f on the same branch. The only conflict was README’s generated gallery; regenerating it from combined docs/images/gallery.tsv preserves current main’s games and the existing Z-A caption. Range-diff changes are gallery context only. Hook, rewriter and focused hook test sources match the previous head; current main’s shared frame controller was freshly exercised.

On this exact head, 92 focused Python hook/layout/profile/docs/settings tests completed: 87 passed and five optional Unicorn cases skipped. The native frame-lock fixture and all 78 frame-step checks passed. The workflow-pinned Python ratchet passes: 371 findings against 371 recorded, zero new or stale findings. Generated gallery, remaining diff and git diff --check were reviewed. Remote CI on this replacement head is pending verification.

No fresh gameplay, benchmark, shader translation, game regression or device run was performed. Z-A is the affected game: the hook is guarded to its verified 2.0.2 main build; layout coverage also protects other frame-step mains. Full game builds/runtime inputs were not established for this scoped refresh. Historical evidence below applies only to its recorded revisions. The unresolved p99 regression remains 37.6 → 52.3 ms (+39.1%) under busy load; two qualified main runs and zero qualified candidate runs do not establish a performance pass. Sustained 60 fps, stall/audio/iOS/full-game coverage remain open.

Historical proposal, validation and original commit context

The complete previous description follows. Its earlier “current” sections, tool versions, revision identities and pass/failure claims are historical, not newly repeated validation.

The verified Z-A 2.0.2 adaptive frame-step hook and profile choices remain absent from main.

Current refresh — 2026-11-05

Rebased e8adef09b0f4a8d43bd3beda0b84934ed0e6f8ed onto pinned main 865cc35fad7034d17c2190f8ce349f61f5bcaba1, producing 725722f5bd80ccda455cf085684586627438f6bd on the same canonical branch and existing PR. The sole conflict was the generated game-patch catalogue; regenerating it from combined current sources retains main’s newer findings and the Z-A hook. Range-diff changes are catalogue context; runtime feature behavior is preserved.

Fresh validation on this head: 92 focused hook/layout/profile/documentation/settings tests completed (87 passed; five optional Unicorn cases skipped). Native frame-lock tests and all 78 frame-step checks passed. git diff --check passes. The pinned Python ratchet reports 390 findings versus 387 recorded, with three excess reportIndexIssue findings in dm/tools/tests/test_nso_match.py. The same result was reproduced on untouched pinned main with the same interpreter; its blob is identical (042bc4320b0d2a1c22bf296c9877ece03108fb51). This is an inherited lint failure, not a pass; no source or baseline repair is mixed into this feature. Remote CI on this replacement head is pending verification.

No fresh gameplay, benchmark, device, shader build or full game regression campaign was performed. The unresolved historical p99 regression remains 37.6 → 52.3 ms (+39.1%) under busy load; two qualified main runs and zero qualified PR runs do not establish a candidate performance pass. Sustained 60 fps, stall/audio/iOS/full-game coverage remain open. Original commit context and all earlier evidence/limits are retained below as historical.

Historical proposal, validation and commit context

The Z-A 2.0.2 build-gated adaptive frame-step hook and its profile choices remain absent from main.

Current rebase — 2026-11-05

Rebased 4fcb04e2d05c62144df3444a5811f2e91aed6e56 onto fixed current main f8a5618d5f505a4c0a0bcac7c413872d3a53c009, producing e8adef09b0f4a8d43bd3beda0b84934ed0e6f8ed on the same existing canonical and PR branches. Main is an ancestor. This replays the existing feature commit; no new squash or unrelated prerequisite is included.

The sole conflict was README’s generated gallery. It was regenerated from the combined gallery source, retaining all new main games and the Z-A 60 fps option caption. The remaining range-diff is context only; no runtime logic was changed.

Fresh validation and limits

92 Python tests completed: 87 passed and five optional Unicorn execution cases skipped. Native frame-lock checks and all 78 portable frame-step checks passed. Gallery generation is current. Hook, rewriter, frame-lock and frame-step sources match their previously tested revisions; the old native Unicorn execution result remains historical evidence.

The workflow-pinned Python ratchet (Ruff 0.17.2 / Pyright 1.1.414) passes: 389 findings against 389 recorded, zero new or stale findings. The former shared-main B023 issue is fixed on this base; references to it below are historical. No baseline was loosened. Generated documentation and git diff --check were reviewed. New remote CI is pending publication and is not claimed green.

No fresh benchmark, gameplay, device, full shader build or end-to-end game check was performed. The p99 regression remains open (37.6 → 52.3 ms, +39.1%, both busy runs); two qualified main runs and zero qualified PR runs do not establish a candidate performance pass. Sustained 60 fps, controlled stalls, audio, iOS and full-game coverage remain unverified.

Historical proposal, validation and original commit context

The description below predates this rebase. Its commit identities, timing tables, tool environments and validation limits remain historical; they are not a current all-pass or fresh gameplay claim.

Main has the shared adaptive frame-step controller, but does not register this verified Z-A 2.0.2 hook or its profile choices. The build-gated hook, shared frame-state layout coverage and durable unresolved performance findings remain necessary. Current main’s 120 fps profile semantics are retained.

Current refresh — 2026-11-04

Candidate 4fcb04e2d05c62144df3444a5811f2e91aed6e56 is exactly one commit directly atop fresh main 975bb4c14456d145eb3d969814534eecdd996ce9. The canonical branch and existing PR destination are unchanged. The published head was a42256783cb3a3d0595ae68fc77d2324d5d69aef; preserved local pre-pass candidate was 1747221712bd7faafb6fd56286c6267261f4bb54. Rebase range-diff is patch-equivalent, and the pre-squash tree 33b1100ce07d19dee62a42499e20ca8fd9bb55a4 equals final tree 33b1100ce07d19dee62a42499e20ca8fd9bb55a4. No unrelated prerequisite or feature was dropped. Original author credit is preserved.

Validation and limits

44 focused hook/profile/documentation/settings tests completed: 39 passed and five Unicorn execution cases skipped because that optional dependency is unavailable in the present environment. The gallery, patch inventory and symptom generators are current. Hook/profile, rewriter, test, frame-lock and frame-step blobs are identical to tested 17472217, whose 92-test suite (including five native Unicorn cases), frame-lock fixture and 78 frame-step checks passed before this rebase. That older result is reused only for those identical sources, not reported as a new runtime result.

No gameplay, shader translation, performance rerun or device run was performed. The historical p99 regression remains unresolved: 37.6 → 52.3 ms (+39.1%), both runs under unrelated shader load. There are two qualified main runs and zero qualified PR runs in the later comparison; sustained 60 fps and controlled stall/audio/iOS/full-game coverage remain unverified. All detailed historical limits and measurements below remain applicable.

Shared Python lint is blocked by unchanged main dm/games/settings.py:115 Ruff B023 (390 findings versus 389 baseline), confirmed on the pinned base. No unrelated repair or baseline alteration is included. Generated documentation, final main diff and git diff --check were reviewed for PR #895 placement/artifact rules; no planning journals or run-specific evidence were added to repository documentation. Remote CI for this new unpublished SHA has not run; previous CI results are historical.

Historical context and evidence

The description below predates this refresh. Its revision names, validation runs, measurements and limitations are retained as historical evidence rather than current all-pass claims.

What and why

Z-A 2.0.2's native interval selector caps rendering at 30 fps. This adds a build-gated 60 fps option that feeds the existing host frame-step controller into the game's graphics interval and native clock dispatch, so ordinary frame drops advance game time by the corresponding whole-vsync duration. The launcher defaults to 60 fps and retains 30 fps; DM_FPS_TARGET=0 restores the original selector.

Independent verification requested before merging. At the 30 fps cap, an earlier headless station comparison measured p99 frame time rising from 37.6 to 52.3 ms (+39.1%). Both runs had competing shader compilation. The cause remains unresolved. The prior benchmark series produced two qualified main runs and zero qualified PR runs before further benchmarking was waived for review.

The hook is restricted to main build b1f12fd919eae86ab8a978317677e64b, asserts the original instructions, and preserves the game's paused-clock behavior. It uses the original graphics setter, duration table, and all three clock adapters. The shared rewriter also reserves the state page before emitting appended patch-area branches: this build's key page ends at a 64 KB alignment boundary, where the previous layout overlapped state with code. Layouts that already have room, front patch areas, and modules without a frame step stay unchanged.

Adds ARM64 hook execution tests, state-layout tests, station benchmark/smoke routes, and the 60 fps launcher/gallery documentation. No host or shader-chain implementation changes.

Details: game note, state allocation finding.

Current rebase and focused validation

Revision a42256783cb3a3d0595ae68fc77d2324d5d69aef rebases published 1d4e86d8782da5c59cf5edf727ea6cc102c185cc onto fixed main bd98317eecfe832b40d401219c15207a398e78dd. All four Z-A feature/documentation commits are retained. The README gallery conflicted with newer upstream entries; regenerating it from the combined gallery.tsv keeps all upstream games and exactly one Z-A cell with the existing 2.0.2 caption. The old gallery-only correction becomes redundant after this regeneration and drops. Final main-to-candidate README diff is one caption line; the full range-diff records upstream context in the generated tables and symptoms, with the remaining three documentation patches identical.

The Z-A build-gated hook, profile, ARM64 test source and frame-state layout tests are byte-identical to the published head. The generic frame-limit host source is also identical. This does not make the older whole-system shader/performance evidence current: main's shader chain and unrelated host/graphics sources changed.

Fresh validation on Apple M2 Max, arm64 macOS 26.6, Xcode 27.2 and native Python 3.14.6:

  • test_za_fps, test_patches, test_tail_call, test_docs and test_nsp_incremental passed all 123 tests with zero skips using native Unicorn 2.1.4. This includes the five ARM64 hook execution cases, registered-build/original-byte checks, disabled/startup paths, varying clock steps, register preservation, patch-state alignment and upstream rewrite/incremental-reuse behavior. The first dependency-free run skipped the five optional hook cases; the complete pinned-dependency run above executed them successfully.
  • Native t_fpslock, freshly built with GAME=0100F43008C44000, passed its found-field, build-gated, integer/float/vsync and override cases. It uses synthetic data, not a running game.
  • Gallery, patch inventory and symptom generators completed with no residual diff. Documentation and git diff --check passed. Durable frame-rate findings, timing tables and open limitations remain in the game note, with the shared state-allocation reference under “Found on this game.” No agent planning/progress artifacts are included.
  • regress.py impact identifies four broad shared-rewriter matches and 130 profiles without usage manifests. The direct target is Z-A 2.0.2; Hades, Breath of the Wild, Pokémon Scarlet and Tears of the Kingdom are additional shared-layout targets and remain untested. A Z-A-only static check --no-smoke using a cached-only guard stopped with exit 2 before translation: the current chain cache nvn-316fb82e2f22-bbc470421a6e-8f71dc0e15411377 is cold. Its report is ERROR; no current shader/interface result is claimed and no compiler lock was relaxed.

No game, benchmark, screenshot, device or simulator run occurred in this rebase pass. The p99 increase from 37.6 to 52.3 ms (+39.1%), zero qualified candidate trials in the later station series, sustained-60-fps caveat and need for independent verification remain unresolved. Current shared-main lint/remote CI and a fresh full graphics suite are not claimed here.

Earlier integration and focused validation — historical

Tested 95c377be7addc35c4e181ba9dbba43714badf336 against main e70fd69d5c828c906905991872c2eeead435dd4e. Main now finds a target-rate field for Fire Emblem Fortune’s Weave from code that reads and sets it. Running the upstream dm/tools/fps_target.py on the extracted, unmodified Z-A 2.0.2 main produced build ID b1f12fd919eae86ab8a978317677e64b and “no target frame rate”. Z-A therefore retains its build-gated interval and clock hook. Both mechanisms appear in the profile-key documentation and generated patch inventory.

  • On an Apple M2 Max, macOS 26.6, the six Python modules test_docs, test_game_profile, test_patches, test_za_fps, test_fps_target and test_txq_type passed 50 tests with zero skips. The five ARM64 hook cases ran under native Unicorn 2.1.4, including disabled/startup behavior, original-instruction and build gates, register preservation, and variable clock steps. The seven TXQ cases used the bundled translator. Host fixture dm/host/tests/build/t_fpslock, built with GAME=0100F43008C44000, passed the generic found-field and build-gated paths. The gallery and diff checks passed.
  • The previously carried TXQ test fix is now upstream in 379e885e. The prior and upstream variants decode identical input and both fail with the missing opcode name. This PR uses main’s test verbatim and keeps its four Z-A commits.
  • The profile hook reaches only the named Z-A build. The shared patch-area alignment logic can reach other profiles with appended frame steps. regress.py impact reports four broad matches and 129 profiles without usage manifests. This maintenance pass used synthetic fixtures and read-only code inspection. No gameplay, device test, or station performance measurement ran on this revision.

Historical station comparison and pre-merge handoff

The 2.0.2 Mac assets were rebuilt from the NSPs on the M2 Max. All 28,603 Mac shader libraries built, and the applegpu_g14s archive contains 26,029 bases. Both revisions were set up to use the same archive with the matching chain, depth mode and shader pairs. This Mac used Metal 32023.921. The repository pins 32023.922.

The local saves/station fixture was copied from the original player save and checked byte-for-byte. Each trial got a fresh copy. A screenshot confirmed the starting scene and camera on the Lumiose Station platform. The headless route ran for 100 seconds at DM_FPS_TARGET=30 in docked mode with audio disabled. Measurements use seconds 40–90.

Qualified run FPS Frame p50 Frame p99
Main 99330eb8, run 1 25.4 39.62 ms 46.07 ms
Main 99330eb8, run 2 29.9 33.34 ms 33.85 ms

An earlier setup run of main measured 29.9 fps and 34.18 ms p99. The new PR attempts on a7be7395 were excluded for contention. None supplied a qualified candidate measurement. Both the original performance finding and the sustained-60-fps caveat remain open.

For an independent tester: run the full station route twice per revision on an idle Apple-silicon Mac with the same verified save, graphics settings and prewarmed archive. Check for competing work throughout each run and post the individual p99 values, FPS and screenshot comparisons here. If the increase repeats, investigate the per-frame CPU, GPU and present timings before merging.

Historical author validation

  • Rebased only this feature onto upstream 372a8d8a0404; unrelated controller work is excluded. The hook and state-layout logic are unchanged from the initial gameplay tests.
  • python3 -m unittest discover -s dm/tools/tests: 861 tests, 21 optional skips, passed on the rebased tree. The native Mac packaging tests required running outside the filesystem sandbox.
  • python -m unittest dm.tools.tests.test_za_fps dm.tools.tests.test_patches: 23 passed, including the five new hook tests under Unicorn/x86 Python. Covers both caps, varying steps, startup, disabled mode, registers/flags, original-byte/build gates, and state allocation.
  • Local execution of the original game selector, all three native adapters, the real duration table, pause dispatch, clock stores, and graphics setter: 24 cases passed again after rebasing. This check uses the owner's original executable and is not committed.
  • make -C dm/gfx/tests GAME=0100F43008C44000 -j6 run: complete Metal graphics suite passed, including the shared frame-step controller tests.
  • dm/tools/lint_python.py: 391 baseline findings, zero new findings. Generated docs and diff whitespace checks passed.
  • Pokémon Legends: Z-A 0100F43008C44000, 2.0.2, on Apple M2 Max / macOS 26.6 / Xcode 27.0. Earlier windowed gameplay covered the station, camera movement, and timed two-second walks. Native clock counters measured 59.70 game seconds / 59.73 real seconds (1.000) and 45.57 / 45.52 (1.001) through natural frame drops; a probe saw all 11 clocks receive 33,333,334 ns once per presented frame at hold 2.
  • The earlier self-contained Mac app's headless smoke reached station gameplay for 120 seconds, produced a correct screenshot, and exited gracefully. Its resource signature verified. That local app predates the PR rebase and is not distributed with this PR.
  • Historical full headless regression: upstream 372a8d8a0404 versus feature commit 68d75dfab2f9, 100 seconds each, target 30. Both reached gameplay with matching screenshot dHashes, unchanged 28,603 shaders, and no new red-line kinds. The overall result is REGRESSION due to p99 frame time, not a clean performance pass; exact report below. --record correctly did not write a green validated.tsv.

Caveats and remaining validation

  • This enables a 60 fps cap; it does not make the GPU render every scene at 60. The title held 60 fps, but the station took roughly 27 ms of GPU work per frame and held mostly 30 fps in the windowed test. Sustained 60 fps gameplay has not been demonstrated on this M2 Max.
  • Normal-speed compensation is bounded. The shared controller uses one, two, or three vsyncs per update (60/30/20 fps) and bounded catch-up for late frames. Sustained rendering below 20 fps or long stalls can still slow simulation. This PR does not change those controller limits.
  • Natural frame drops, variable-step execution, startup, disabled mode, and paused clocks were checked. There is no controlled runtime stall-injection test establishing behavior for every hitch pattern.
  • Runtime coverage is the station arrival save, standing, camera movement, and short walks. Battles, longer world transitions, other cutscenes, full-game progression, and audio synchronization have not been systematically checked. These automated runs had audio disabled.
  • No iPhone/iOS runtime validation, other Mac GPU validation, or other Z-A version validation. Other main builds receive no fixed-address hook; there is no automatic function-matched port for frame-step stubs.
  • Only Z-A was available for game regression testing. regress.py impact broadly flags the rewriter for every game (the available manifests list Hades, Breath of the Wild, Pokémon Scarlet, and Tears of the Kingdom; 122 profiles have no manifest); this PR limits the shared change to registered frame-step mains and tests every key-page alignment, SDK/unregistered modules, and front layouts. Other games remain unchecked.
  • Window focus and Spaces changes interrupted some windowed attempts. The regression and final automated comparisons therefore ran headlessly at the user's request, using a temporary harness wrapper that removes DM_WINDOW/DM_WINDOW_TOP/DM_METAL_HUD and records DM_TEST_HEADLESS=1. Headless runs establish execution/rendering, not display-link or fullscreen pacing.
  • The historical PR regression also ran while an unrelated shader compiler was active (--wait-idle 0); both runs are marked busy. The run uses the preserved pipeline archive stamped for chain b7cd656abd7c, rather than the shared build directory whose stamp changed during PR preparation. Its timings are non-isolated. The p99 increase could reflect load, patch behavior, or both; an idle-machine rerun is required before merge.
  • The four single-run headless walking samples below experienced changing GPU load (individual GPU frames reached 191.64 ms). They are not evidence of a performance improvement, a slowdown caused by the patch, or a precise cap-to-cap comparison. None reached the second 1,800-frame counter sample needed for the harness's game_speed result; the measured normal-speed evidence comes from the separate windowed clock run.
  • Existing SetRenderEnableConditional (the host draws anyway) and retry-success memory-pool red lines occurred in the earlier tests. No new red-line kinds were introduced in the recorded comparison. This PR does not resolve those existing limitations.
  • In the earlier author environment, native arm64 Unicorn 2.1.4 faulted during its own initialization on this Mac, before executing a test. The five hook tests were executed successfully using Unicorn under x86 Python/Rosetta; the game and Metal runs themselves were native arm64.
  • The tracked station route depends on the owner's local <NSP folder>/saves/station fixture. The rebuilt Mac assets and restored fixture are local test inputs. The package, game files, save and screenshots are excluded from the PR.

Earlier headless benchmark samples

station-walk, 40–140 seconds, one run per variant; these pre-rebase measurements are retained with the load caveat above. The hook and frame-state layout logic did not change during the rebase.

Variant Operation mode Measured fps Frame p50 / p99 (ms) GPU p50 (ms)
Original, target 30 Handheld 28.5 33.37 / 71.16 26.43
Patched, target 30 Handheld 22.4 37.05 / 111.35 32.77
Patched, target 60 Handheld 20.6 49.72 / 77.70 36.31
Patched, target 60 Docked 19.7 49.34 / 109.89 36.35

Regression report: full check — REGRESSION

Baseline origin/main 372a8d8, candidate HEAD 68d75dfab2f9; Apple M2 Max, macOS 26.6, Xcode 27.0; 237.4 s

game status shaders (base → cand) newly failing newly building changed MSL interface (new / known) boot fps p50 frame p99 ms peak MB prepare s new RED
LegendsZA 0100F43008C44000 REGRESSION 28603/28603 → 28603/28603 0 0 0 0 / 0 ok 29.8 → 29.6 37.6 → 52.3 2352 → 2317 None → None 0

LegendsZA 0100F43008C44000: REGRESSION

  • REGRESSION: frame p99 37.6 → 52.3 ms (+39.1 %)
    • screenshots (s: dHash bits / RGB diff / baseline noise): 50: 0/0.45/0, 80: 0/0.45/0
    • baseline: exit None, first frame 1.4 s, max frame 2927, reached True, prepare None s, prebuild 3.2 s (0 built, 0 failed), fps 29.8, p50/p99 33.33/37.6 ms, peak 2352 MB, busy Mac
    • candidate: exit None, first frame 1.4 s, max frame 2918, reached True, prepare None s, prebuild 0.9 s (0 built, 0 failed), fps 29.6, p50/p99 33.31/52.3 ms, peak 2317 MB, busy Mac
    • time: chain 31.1 s, smoke 205.9 s

Historical README gallery verification

At eb3bdb13, the merge from main left two rendered Pokémon Legends: Z-A cells in the README. The gallery source contains one entry with the 2.0.2 frame-rate caption. The same gallery test passed on the merge base c7ba23df and failed on the PR head. Running python3 dm/tools/docs_gallery.py at 1d4e86d8 restored one cell with the caption.

python3 dm/tools/docs_gallery.py --check, all 11 tests in python3 -m unittest dm.tools.tests.test_docs, and git diff --check passed locally. The generated gallery contains 129 distinct games. This README-only correction required no game or performance rerun.

Historical original commit context and preserved corrective messages

These are the original published and preserved local messages before this squash. They explain historical intent and limitations; any validation named in them belongs to the original commit, not the new candidate. Repeated equivalent messages are shown once with their original identities.

seedds [email protected] — 0fb4524c9b3d913c1300d0ec3ef4bbd69251cb89 (published), c4bf5518c89f2f365a7383cab90e26c9fa0d9463 (preserved unpublished/local)

Add adaptive 60 fps support for Pokemon Legends Z-A 2.0.2

seedds [email protected] — 4cb60a7782a192dd8682c4faa501c7451630c87a (published), 6e449de07eeee664b0d91eda473b28059dfbd2eb (preserved unpublished/local)

Document PR-base checks and unresolved frame-time regression

seedds [email protected] — f7c51ba4622ab32c2f1caeccbbd1e70cdf3c9529 (published), 75a4c41b568669e803abc63d18889eb691d72b08 (preserved unpublished/local)

Separate Z-A frame-rate findings from validation evidence

seedds [email protected] — a42256783cb3a3d0595ae68fc77d2324d5d69aef (published), 1747221712bd7faafb6fd56286c6267261f4bb54 (preserved unpublished/local)

Keep the Z-A performance finding current for review
Published commit context before this rebase

Historical message from 4fcb04e2d05c62144df3444a5811f2e91aed6e56; any validation statements belong to that revision.

Add adaptive 60 fps support for Pokemon Legends Z-A 2.0.2

Register the verified frame-step hook and profile choices, with build-gated rewrite coverage and normal-speed timing tests. Preserve the unresolved frame-time regression and incomplete runtime coverage in the durable game findings.

@thehobbit85
thehobbit85 force-pushed the codex/za-dynamic-60fps branch from 176ca3e to a7be739 Compare November 2, 2026 06:00
@thehobbit85
thehobbit85 marked this pull request as ready for review November 2, 2026 08:31
@thehobbit85
thehobbit85 force-pushed the codex/za-dynamic-60fps branch 6 times, most recently from f0895cc to d56cb76 Compare November 3, 2026 02:57
@github-actions github-actions Bot added rewriter The NSO rewriter and per-build patches tools Tools and scripts (dm/tools, scripts) docs Documentation game: 0100F43008C44000 Pokémon Legends: Z-A labels Nov 3, 2026
@thehobbit85
thehobbit85 force-pushed the codex/za-dynamic-60fps branch 6 times, most recently from e8adef0 to 725722f Compare November 5, 2026 18:03
@thehobbit85
thehobbit85 force-pushed the codex/za-dynamic-60fps branch 7 times, most recently from 4fdcf17 to 448e17f Compare November 13, 2026 06:16
@thehobbit85
thehobbit85 force-pushed the codex/za-dynamic-60fps branch from 448e17f to eb0030f Compare November 20, 2026 06:26
@thehobbit85 thehobbit85 reopened this Nov 20, 2026
@thehobbit85
thehobbit85 force-pushed the codex/za-dynamic-60fps branch 6 times, most recently from 8df1d20 to d43b2f6 Compare November 25, 2026 08:12
SaranSundar pushed a commit to SaranSundar/nxnative that referenced this pull request Nov 26, 2026
…ked at; patch index regenerated

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@thehobbit85
thehobbit85 force-pushed the codex/za-dynamic-60fps branch from d43b2f6 to 8901aa5 Compare November 27, 2026 01:26
@thehobbit85
thehobbit85 force-pushed the codex/za-dynamic-60fps branch from 8901aa5 to 08f1ede Compare November 27, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation game: 0100F43008C44000 Pokémon Legends: Z-A rewriter The NSO rewriter and per-build patches tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants