Repository navigation
fix(agc): honor bounded direct index fetches - #4824
krishalivaibhav wants to merge 2 commits into
Conversation
|
The corrected head is Local evidence is scoped in the description: the protected-page GPU fixture fails with the saved pre-fix driver and passes with the candidate on M2/MoltenVK, five focused local checks pass, and the changed translation units compile against the stated main base. Full clean-main linking and Linux/Windows execution remain unverified. Keeping this draft until that evidence is available. AI-assisted: yes. |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
|
Heads-up from #5205 (skip an indexed draw with no indices or instances): it replaces the Written with AI assistance (Claude Code). |
|
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line. |
|
Follow-up evidence, keeping this closed pending the requested current-main title reproduction. A historical Balatro capture contains the exact bounded case: I replayed that unchanged packet through This is validation-only evidence: the small caller links with dead stripping/dynamic lookup for unused execution dependencies. It does not verify a full driver link, GPU zero-fill rendering, or a game reaching this packet on a complete current-main runtime. Historical integrated-runtime A/B and guarded-page rendering evidence remain separately scoped. I am not presenting this as satisfying the full title-reproduction condition or as an FPS improvement. Written with AI assistance. Title and pristine-main attemptThe title is Balatro PPSA21402, version 01.015.000 (verified from the dump’s I attempted a pristine runtime build at the pinned main above, with Release/x86_64 and main’s exact dependency revisions. Configuration succeeds, but the runtime build stops in Could a contributor with a working current-main runtime and this Balatro version check whether it reaches the same bounded packet (42 requested, maximum 1), attach the title/error log, and compare rendering with this change? That current-main title run remains needed before reopening. Linux baseline follow-up — 14 October 2026I have now built the complete Release relinker and runtime libraries from the same pinned main ( Balatro PPSA21402 01.015.000 was converted using that freshly built relinker and launched with those freshly processed runtime libraries. The clean ELF inputs were independently checked against the original dump's ELF headers, program headers and all loadable segment payloads. Direct Rosetta loading rejected the generated ELF layout before game execution; invoking the existing glibc loader explicitly allowed execution without modifying the generated executable or runtime libraries. The effective startup probe ran for 150 seconds, executed game code, initialized Vulkan and compiled shaders, then ended at its intentional time limit (SIGTERM; no forced-kill fallback). It did not emit the index-count rejection above. The headless probe did not establish visible menu/gameplay or exercise a later gameplay scene, and software rendering limited progress. An independent reviewer checked the build/conversion logs, input provenance and executable/library hashes. Therefore this does not yet satisfy the requested title reproduction, and I am keeping this PR closed. The packet-validator result remains separate from this actual title-startup result; neither establishes an FPS improvement. |
What
Direct
DRAW_INDEX_2andDRAW_INDEX_OFFSET_2packets can request more indices than theirmax_sizereadable prefix. Keep the requested draw count, read onlymin(count, max_size)guest indices, and supply zero indices for the remaining fetches. ForOFFSET_2,max_sizeis already relative to the packet offset. This replaces the count-greater-than-max rejection and prevents reads beyond the guest range.The bounded 16/32-bit vertex path uses an owned padded buffer, preserves primitive restart behavior, and does not reuse snapshots or in-place imports for the synthetic tail. Alias checks cover only the real guest prefix. Bounded mesh fetches and the existing unsupported 8-bit graphics path remain explicit errors; indirect packet semantics are unchanged.
The packet contract is consistent with PAL index packet construction and Mesa draw emission.
Tested
agc_driver_pm4,agc_driver_pm4_failure,agc_driver_viewport_depth,agc_driver_graphicsandagc_driver_draw_offset_indicespassed.43e3a70f8143f014f621c48abbdb137fffd7346ein an isolated checkout;git diff --checkpasses. Independent agent review found no blocking issue.Focused clean-head Linux linking and execution now pass as recorded below; full suites, Windows execution, and a merge onto the latest main remain unverified. The local complete macOS build uses additional unpublished runtime changes. This PR does not claim stable game completion or a performance improvement.
Additional verified Linux evidence
Clean Linux/lavapipe execution on exact head
0976b1eb421061b75077b3e537ea7c8160330b45: built the actual graphics runtime and bounded-index/PM4 targets.agc_driver_bounded_index_fetch,agc_driver_pm4_failure, andagc_driver_pm4_priority_refusedall passed three consecutive runs, with skipped tests rejected. Hosted logs. Lavapipe is a software Vulkan renderer; this is neither Windows GPU coverage nor a passing full game session. The production-only negative control remains the earlier local integrated-runtime result described above.Checklist