Skip to content
This repository was archived by the owner on Nov 16, 2026. It is now read-only.

Preserve interior codegen entries and reduce registration compiler memory - #4

Draft
AlenHay wants to merge 3 commits into
NeverCookFirst:codex/native-rendererfrom
AlenHay:codex/sdk-codegen-correctness-pr-20261007
Draft

AlenHay wants to merge 3 commits into
NeverCookFirst:codex/native-rendererfrom
AlenHay:codex/sdk-codegen-correctness-pr-20261007

Conversation

@AlenHay

@AlenHay AlenHay commented Oct 7, 2026

Copy link
Copy Markdown

An explicit entry inside a preserved PowerPC function body could otherwise be lost, emitted with the wrong body owner, or re-enter through the normal prologue. Add validated body-owner configuration and entry-aware emission so callable interior entries preserve the caller's existing frame and execute the original epilogue. Maintain address indexes across graph replacements, removals and moves, and preserve deferred entries during gap filling.

Validation from the tested integration: fixtures execute actual unmodified CodegenWriter output with the real SDK headers and check backward branches, CTR, calls, multiple bodies and epilogues. Graph registration and gap-fill regressions passed. Fresh game generation applied five explicit body mappings. Rebuild the codegen CLI before using body-owner configuration; older parsers silently ignore that field.

A generated registration function with 165,261 direct SetFunction calls exceeded the compiler memory limit. Emit an ordered constexpr table of addresses and function pointers plus one registration loop, preserving hook/import relocation behavior and visiting every entry even when SetFunction returns false.

Validation from the tested integration: fresh game codegen preserved all 165,261 addresses, symbols and binding order; all other generated instructions and headers were byte-identical. Actual-header compile/link/execute fixtures passed for mixed hooks/imports/interior entries, empty, single-entry and DLL output. The full native Windows game then built at about 2.4 GiB peak owned-process RSS. The expanded five-case regression initially exceeded its 60-second global timeout; the scoped 180-second deadline passed in 127.54 seconds, retaining individual 40-second compile and 5-second execution limits. Unit checks had 212 passes and four existing BitStream skips.

This establishes compiler memory improvement and registration equivalence; it does not establish a game FPS improvement.

This is an independent draft against codex/native-renderer (dependency PR #1). The related SDK PRs share only test-registration infrastructure; their combined production/test files match the validated integration 2897c31b1407dd96480dc25965f8ee7807f00e0f. CMake registrations were restricted to each PR's fixtures and checked for missing files. These isolated branches were not separately rebuilt; validation above describes the prior integration run, not new CI results.

The exact tested integration is published at https://github.com/AlenHay/rexglue-sdk/tree/codex/runtime-correctness-20261007 for the renderer dependency pin. Game inputs, generated game code, shader banks, captures and saves are excluded.

Add validated body-owner configuration and entry-aware emission, preserve deferred graph entries, track address index changes across node replacement/removal/moves, and sweep gap-fill graphs efficiently. Ship actual generated-code execution and graph behavior fixtures with the feature.

Run generated-code fixture at the SDK x86-64-v2 baseline. Rebuild codegen consumers before using body-owner configuration; older parsers silently ignore that field.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant