Skip to content

Fix native renderer correctness and publish reproducible SDK integration - #28

Draft
AlenHay wants to merge 40 commits into
NeverCookFirst:codex/native-rendererfrom
AlenHay:t3/gpu-renderer-correctness
Draft

AlenHay wants to merge 40 commits into
NeverCookFirst:codex/native-rendererfrom
AlenHay:t3/gpu-renderer-correctness

Conversation

@AlenHay

@AlenHay AlenHay commented Oct 7, 2026

Copy link
Copy Markdown

The native renderer could clip a promoted 1280x720 Xbox tile target to its physical 512-row surface header, squashing the menu and leaving its lower portion incomplete. Preserve the original TU23 viewport/scissor CPU semantics and provide the promoted logical extent through the original setter's scoped clipping branch. The corrected build restored the full-height menu and replayed a powered Vorton checkpoint into gameplay.

This is a follow-up to #25, based on its codex/native-renderer branch. It remains an experimental draft; LEGODIMENSIONS_NATIVE_GPU is OFF by default.

Changes

  • Correct private viewport representation, promoted-target clipping, scissor enable/empty rectangles and the audited TU23 alpha reference.
  • Validate index windows, guest texture residency, depth sampling channels, upload failures, submission completion, frame-ring replacement and shader/pipeline failure paths.
  • Recover missing shaders through validated additive DXIL packs; publish prelinked banks transactionally and track actual build fingerprints/provenance.
  • Add bounded frame/GPU diagnostics, isolated checkpoint regression tools and explicit coherent PM4 reference settings. State caching remains opt-in and disabled for the correctness comparisons.
  • Restore stock Plume image-to-buffer copies, with pin-checked compatibility patches and an actual Intel Vulkan readback prototype.
  • Publish the exact SDK integration through a fetchable public fork and document its focused SDK review PRs.

Validation already completed

  • The expanded renderer suite passed 68/68 checks before the promoted-viewport follow-up. Its changed scissor/viewport/draw paths subsequently passed 3/3 targeted checks, including actual unchanged TU23 setter bodies and the original 512-row negative control.
  • The current regression tooling passed 42 asset-free cases. Shader-bank generation, cross-build producers, resource and synchronization fixtures exercise production paths; these checks are not substitutes for rendered game validation.
  • A complete matching Windows game/runtime/plugin build passed. Compact SDK registration preserved all 165,261 bindings and enabled the full game build at about 2.4 GiB peak owned-process RSS.
  • Live build fingerprint 54d86a1b958e726e restored the 1280x720 menu. Actual post-promotion logs confirmed requested and effective dimensions; normal save replay reached Vorton with Gandalf, Wyldstyle and Batman present.
  • A coherent PM4 comparison used the same executable, runtime, save checkpoint and prepared tag bytes. It confirmed a remaining native ground-shadow gap. Small camera/pose differences prevent a pixel-perfect comparison; PM4 is a source-matched reference, not an independent Xbox capture.
  • The real Intel Vulkan ABI/readback prototype returned 4,096 byte-identical pixels. This verifies that prototype and copy path, not a native Linux game renderer.

These are prior local results. Publication did not restart the game, rebuild it or claim a new CI pass. Test bodies and reconstruction instructions are committed; game-derived evidence remains private.

SDK dependency and review

The SDK pin is 2897c31b1407dd96480dc25965f8ee7807f00e0f, published on https://github.com/AlenHay/rexglue-sdk/tree/codex/runtime-correctness-20261007. The current account cannot push to upstream, so .gitmodules points to that public fork. The original SDK dependency draft remains NeverCookFirst/rexglue-sdk#1.

Focused independent follow-ups against its codex/native-renderer branch:

Their production/test files match the tested integration; each draft registers only its own fixtures. The isolated drafts were not separately rebuilt. Public runtime layout changes require rebuilding the runtime and all consumers together. Local dependency edits are excluded: use the tracked SIMDe and Plume preparers to reconstruct required overlays.

Remaining gaps

Large native ground shadows remain missing; the exact failing pass is unproven. No causal performance gain or stable 60 FPS is established. Full level/campaign completion and a run without crashes or visual glitches remain unverified. Native rendering still uses Windows D3D12 through Proton; no native Linux renderer exists. A separate SDK Linux PM4 build was stopped before final links, and no Linux game was launched.

Generated game code, executable/disc inputs, shader banks, captures, saves and private testing artifacts are excluded. See tools/gpu-aot/COLLABORATION.md for the complete handoff and reconstruction limits.

AlenHay added 30 commits October 7, 2026 03:39
Track a process-wide write epoch under the SDK critical region so repeated validation of unchanged page snapshots skips redundant scans. Physical writes and device shutdown invalidate the shortcut; counter wrap disables it permanently.

Validation: production watcher fixture, cache-removed negative control, four real SDK page-fault modes, and the 51-check portable GPU suite passed. The native Windows build passed; no frame-rate improvement is claimed.
Bound shader parsing and placement lookup by readable guest allocations, capture missing shaders by full container identity, and distinguish failed nonnull binds from intentional null pixel shaders.

Add opt-in offline pack export and transactional runtime publication tied to exact renderer/compiler provenance. Preserve existing archive pointers and successful bindings while allowing missing resources to recover without a restart.

Validation: production archive, guarded parsing, capture deduplication and lookup fixtures passed in the 51-check portable suite; the native Windows build passed. Actual exported packs were accepted by the production parser and generation 1 loaded in a running game. Campaign-wide shader coverage remains incomplete.
Convert borrowed single-level UNORM24 textures into immutable R32 sampling mirrors and refresh the bound descriptor after first upload. Preserve host resolve authority and reject failed or unreadable CPU uploads instead of sampling stale storage.

Bound 2D and cube block copies, track framebuffer owners for fenced invalidation, cache unchanged authority diagnostics, and allow exact pixel-shader upload capture filtering.

Validation: depth upload and binding fixtures passed from the staged commit snapshot; authority views and event sequences were preserved. The complete native build and 51-check portable suite passed. Live first-use atlas upload was verified; campaign-wide rendering remains unverified.
Reject overflowing or out-of-bounds indexed draws before GPU submission. Extend opt-in range uploads to nonindexed draws and QuadList expansion, retaining stream byte order, signed base vertices, query scopes and fenced upload lifetimes.

Validation: actual stream selection, index guards and QuadList byte-equivalence fixtures passed from the staged commit snapshot, including the excluded-QuadList negative control. The native build and 51-check portable suite passed. Live paused allocation probes used bounded ranges rather than whole mesh-pool copies; no isolated frame-rate or pixel-equivalence claim is made.
Document the existing whole-session PM4 reference route, isolated legitimate checkpoint testing, shader coverage gaps, and distinct acceptance gates for helper tests, rendered output, performance and campaign integration.
Handle optional reflection in the pinned ABI624 compiler without reconstructing metadata. Reject absent vertex-fetch semantic mappings before release-mode iterator dereference.

Apply scratch patches from a fixed repository directory and verify resulting source before publishing provenance. The guard fixture passes from CTest and external directories; skipped-patch negative controls reject incomplete preparation. The actual TU23 image audit accounts for 418 passing and 65 unsupported candidates.
Keep frame-ring allocation transactional and reject invalid D3D12 pipeline handles. A void backend wait now permits retirement only after verified fence completion.

Validation: seven isolated production-body fixtures passed against the staged source snapshot; native Plume fence/resize fixtures also passed.
Prepare private writable snapshots with pinned binaries and saves, launch only explicitly, and compare fixed cadence windows without selecting favorable results. Keep rejected evidence and vary one setting per experiment.

Validation: 32 synthetic checks passed through staged-source CTest. Preparation, report and launcher dry-run passed with the frozen293 real installation and33 checkpoint files;225 independent reflinks, no fallback copies. No additional game was launched.
Count draws and completion work in cadence-only mode, distinguish disabled timing fields, and split optional constant costs into disjoint phases. Add a restart-only3/12 command-slot experiment while preserving three swap-chain images and exact resource retirement; default remains3.

Validation:10 production-body fixtures passed against isolated staged sources. Frozen293 real Vorton comparison found12 slots16.432FPS versus3 slots16.389FPS, so no default promotion.
Read normalized ALPHAREF from offset10500 and initialize its actual integer setter. Offset10620 holds a separate float state and must not drive fragment alpha comparisons.

Validation: actual mappedTU23 words, untouched generated leaf setters, gameplay alpha helper, both renderer reads and968 comparison cases passed. Restoring the old offset fails the exact renderer-reference oracle.
Track guest face culling and winding in pipeline identity, preserve both-face draw/query execution with empty scissor coverage, and select surviving-face stencil and polygon-offset state. Keep culling opt-in.

Provide a one-frame CPU draw recorder capped at64 draws and1MiB, with checked guest-memory reads and arithmetic bounds. Disabled diagnostics perform no capture.

Validation: actual production raster mapping and untouchedTU23 setter passed GNU fixture; recorder/reader failure and bound fixtures passed clang. Frozen293 Vorton already exercises this raster candidate; campaign-wide equivalence remains unproved.
Record opt-in per-submission queue elapsed spans for every command close path. Reuse existing fences, check actual queue frequency and raw readback, consume each pair once, and disable diagnostics gracefully on failure. Keep the sidecar separate from CPU frame cadence.

Validation:10 staged-source CTest checks passed, including34 harness cases and production timestamp/fence/resize bodies; premature readback and duplicate-generation negative controls rejected. Native execution remains the next validation gate.
Retain the previous output until checked writes, flush, sync and close succeed, then replace atomically on POSIX or Windows. Add an explicit bounded prelink-worker budget and byte-preserving large-literal emission with MSVC fallback.

Validation: production publication failure fixture passed POSIX and Windows API shim branches; original unchecked output strategy was rejected. Actual emitted literal/fallback bytes and miniz round-trip passed; worker-budget fixture rejected invalid budgets before spawning.
Replace allocation-wide region enumeration with the SDK's existing locked readability check. Preserve physical mapping, overflow checks, lock order, and invalidation behavior. Production-body equivalence tests cover page holes, protection flags, aliases, endpoints, and 2,000 random spans; the old implementation fails the counted-work regression.
AlenHay added 10 commits October 7, 2026 08:50
Use the published SDK runtime, codegen, platform, and verified SIMDe preparation changes. Map five callable interior addresses to their actual body owners so generated entry points preserve backward branches, live registers, and stack epilogues. Fresh codegen and consumer builds remain the next integration gate.
…tion

Locate actual generated viewport definitions across codegen repartitioning, keep assertions active, and record source hashes. Correct the historical TU23 alpha-reference identification and preserve dated renderer experiment outcomes, SDK publication limits, and the new measured-development approach.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant