Skip to content

Correct cooperative TMATMUL shape and packed Shared operand views - #383

Open
ckwllawliet wants to merge 7 commits into
mainfrom
codex/issue-374-shared-tmatmul-shape
Open

ckwllawliet wants to merge 7 commits into
mainfrom
codex/issue-374-shared-tmatmul-shape

Conversation

@ckwllawliet

Copy link
Copy Markdown
Collaborator

Cooperative TMATMUL currently rejects otherwise legal non-power-of-two shapes and can apply Local scratch limits to real Shared inputs. This change corrects shape legality and private operand addressing for all six cooperative forms, including packed inputs, padding, transpose, large Shared sources and subviews.

Change contract

  • Change classes: normative, tooling, governance, site, tests, docs.
  • Reviewed head: 3eb214759679731685b2f83691329da534e17dd4.
  • Linked NDF architecture issue: #374 (reference only; issue closure is outside this PR task).
  • Frozen decision baseline: e145c45c674fdc41b0b71564abf0e0433a6be29b; reconciled PR base/merge base: f3fa24331df452248366550f71cd1be22e62aeb1.
  • Existing ADR amendments: CUBE-0003, CUBE-0007, CUBE-0009 and CUBE-0012. No new ADR. Historical decision prose is retained; current semantics remain in the owning ASL/NDF.

Changed NDF clauses:

PTO-CUBE-SHARED-TRANSPOSE-001
PTO-CUBE-MATRIX-SCALE-001
PTO-TMATMUL-CONTRACT-001
PTO-TMATMUL-BIAS-CONTRACT-001
PTO-TMATMUL-ACC-CONTRACT-001
PTO-TMATMUL-MX-CONTRACT-001
PTO-TMATMUL-MX-BIAS-CONTRACT-001
PTO-TMATMUL-MX-ACC-CONTRACT-001
PTO-BSTART-TMATMUL-CONTRACT-001
PTO-BSTART-TMATMUL-BIAS-CONTRACT-001
PTO-BSTART-TMATMUL-ACC-CONTRACT-001
PTO-BSTART-TMATMULMX-CONTRACT-001
PTO-BSTART-TMATMULMX-BIAS-CONTRACT-001
PTO-BSTART-TMATMULMX-ACC-CONTRACT-001

Normative owners:

  • asl/block/attributes/B.FPATR.asl.
  • The six asl/block/execution/BSTART.TMATMUL*.asl owners and six asl/tile/matrix-and-matrix-vector/matrix-matrix/TMATMUL*.asl owners.
  • asl/block/model/dispatch/{cube-tmatmul,matrix-scale,shared-cube-matrix}.asl.
  • asl/tile/model/execution/{cube,matrix-scale}.asl and asl/tile/model/legality/{matrix-functions,matrix-shape}.asl.

Normative delta

  • Removes the cooperative N/K power-of-two restriction while retaining real descriptor, capacity and output constraints.
  • A supported packed Shared primary requires even K in every transpose combination and even original physical column pitch. M/N can be odd and valid columns can be smaller than pitch. Subviews retain the parent-pitch constraint.
  • Private input views preserve physical source addressing and avoid imposing Local scratch limits on legal 128/256 KiB Shared inputs. Scale views preserve their fixed logical axes and independently address non-power-of-two group counts.
  • Effective defaults remain 1; an omitted packed K is rejected rather than rounded. Existing unspecified behavior remains unchanged.
  • Arithmetic, type applicability, instruction encodings, distinct C/D capability, readiness/generation/lifetime and atomic output behavior are preserved. Local-only, TGEMV and generic Shared allocation legality are unchanged.

Compatibility: breaking for consumers of cooperative shape legality: more non-power-of-two shapes become legal, while odd K or odd physical pitch becomes illegal for packed Shared primaries. Consumers should update their legality checks and conformance cases. No separately tracked downstream repository PR is required for this V1 change; full release evidence remains a later obligation. The layout-census tooling explicitly classifies private-view relations and retains fail-closed mutation canaries.

Agent review

  • Implementation: independent task execution by GPT-6 Luna XHigh, operational ID /root/issue374_executor.
  • Review: GPT-6.1 Sol Medium, operational ID /root/issue374_reviewer; complete independent implementation review, correction review and final exact-input gate review.
  • Final verdict: approved, review_complete=true, all eight mandatory areas complete, both consolidated findings closed, no unresolved findings. Receipt check: scripts/prepare-pr --base origin/main --head HEAD --review build/pr-review.json passes with review: reviewed for the head above, tree 0bf07b4b337e8c636277d32626fb346c48f5da65 and diff SHA-256 8c7fbef8bda279ab21024b5ac3b8d625032c98b798e8c91ac7a9a72adddac3cb. External execution record: issue-374__review-report-r7.md, SHA-256 d38929f668e8808a3ba5f8c22332e424f06481033dd14499e22fb906a14296a7; local receipt SHA-256 1fb602fe46e25634ddbb4f28016ecd014924ae120c31c67218d8628dda052cfd.
  • Local operational identities and a receipt establish execution provenance/input freshness; they are not authenticated GitHub approval or hosted CI results.

Projections and focused evidence

  • Generated English/Chinese instruction pages and navigation are consistent with ASL.
  • Focused positive, boundary, negative and state-transition evidence covers the delta: 32 distinct passing points, with 2 corrected tests rerun at 5528ca05 and 30 unchanged-input results from 5cb029be. Subsequent changes only affect governance/projections; their reuse eligibility was independently checked. No claim of a single 32-point run at final HEAD.
  • Required catalog, layout census, ADR, static-readiness and mnemonic-coverage projections pass and are idempotent.
  • No legacy, archive, backup or second normative explanation was added.
  • make pr-check on final signed HEAD.
  • git diff --check.

Final signed HEAD passes make pr-check (11/11 checks), site typecheck, site unit tests (14/14), and clean English/Chinese build. Focused migration tests pass 7/7; ADR checks cover 116 records. Site validation uses pinned pnpm 10.30.0. A bounded 8 GiB Node heap setting is used for the clean bilingual build after a preserved default-heap resource failure. No dependency manifest or lockfile is changed. make repo-check is unnecessary because binary/encoding/operand/decoder identity is unchanged.

Release boundary

  • PR validation is intentionally lightweight (V1).
  • Full ASLRef verification, every independent AVS result and reproducible release evidence are deferred to the manually dispatched exact-head release workflow.
  • Release verification is required before a release candidate; this PR does not claim V2 or authorize release publication.

Release impact and known gaps: cooperative legality is architecture-visible. Existing Issue #367 arithmetic/accumulator residuals remain outside this shape/addressing correction. No new arithmetic goldens or precision/rounding/NaN/scale-value behavior are introduced or verified by this task. This task publishes a ready PR only; it does not merge, close the issue, tag or release.

@ckwllawliet
ckwllawliet requested a review from zhoubot as a code owner October 10, 2026 15:48
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