Skip to content

PR 0010 PGRAPH reject oversized inline packets atomically

github-actions[bot] edited this page Sep 14, 2026 · 1 revision

PR #10 — PGRAPH: reject oversized inline packets atomically

PR #10

Status

  • GitHub state: Merged
  • Disposition at review: Merged
  • Current head at review: 659ad30be0488e85bea0df9514a5e52a31fcf290 (feature/eng-2026-433-s-pr09-pfifo-bulk-uc037deed)
  • Reviewed head: 659ad30be0488e85bea0df9514a5e52a31fcf290
  • Last reviewed: 2026-09-14 UTC
  • Base: main at db0905eabd5a1fd0ee1a8e8eb81585db104e256e
  • Subsystem: NV2A / PGRAPH

Review freshness: this page records the final/known PR head at review time. If the PR is reopened or rewritten, re-review before relying on implementation details.

At a glance

  • What it changes: PGRAPH: reject oversized inline packets atomically
  • Why it was attempted: Observed problem: Oversized ARRAY ELEMENT16 , ARRAY ELEMENT32 , and INLINE ARRAY packets could reach assertion-backed expansion or mutation paths before the complete packet capacity was known. Profiling evidence: The earlier valid-packet work showed that bulk inline handling can reduce repeated PFIFO dispatch/bookkeeping. The current-main reconstruction therefore had two requirements: preserve that accepted-packet path and restore whole-packet preflight b…
  • Current/final result: Merged: atomic packet-boundary tests, scalar/bulk equivalence, validation, and accepted-packet performance gates passed.
  • Lesson: Validate the complete inline packet capacity before expanding pending draw work or mutating an inline destination; oversized packets must be rejected atomically.

Code impact

Implementation file Δ Why it matters
hw/xbox/nv2a/pgraph/inline-elements.h +27/-6 PGRAPH inline-packet capacity and atomic-mutation contract.
hw/xbox/nv2a/pgraph/pgraph.c +50/-0 Shared PGRAPH guest-state/method handling and renderer boundary.
tests/xbox/pgraph-inline-elements/pgraph-inline-elements-test.c +25/-0 Focused/regression validation for the implementation contract.

Flow

flowchart LR
    subgraph Before
        A[Guest inline packet] --> B[Begin expansion/mutation] --> C[Discover capacity problem] --> D[Partial state possible]
    end
    subgraph PR_10[PR #10]
        E[Guest inline packet] --> F[PR #10 capacity preflight] --> G[Atomic accept or reject] --> H[Consistent PGRAPH state]
    end
Loading

What changed

Restore pending-draw-aware packet planning. - Preflight complete inline packets before handler dispatch/mutation. - Account for ELEMENT16's two values per word. - Consume malformed dispatch units through a controlled guest-error path. - Preserve existing valid bulk/scalar loops and add focused boundary/equivalence coverage. Main code path: hw/xbox/nv2a/pgraph/pgraph.c , inline-elements.h , focused PFIFO tests Commits: merged candidate 659ad30be0488e85bea0df9514a5e52a31fcf290

Result

Merged: atomic packet-boundary tests, scalar/bulk equivalence, validation, and accepted-packet performance gates passed.

Lesson learned

Validate the complete inline packet capacity before expanding pending draw work or mutating an inline destination; oversized packets must be rejected atomically.

Avoid repeating

Do not begin ARRAY_ELEMENT/INLINE_ARRAY mutation and then discover the packet is oversized; partial mutation leaves PGRAPH state inconsistent.

Docs / evidence

Pointers only; the detailed evidence remains in its original location.

Related architecture

Clone this wiki locally