Skip to content

spec(PP-ARCH-001): shared-block forward-path consolidation — the axis that actually sets new-model cost - #3424

Closed
alfredodeza wants to merge 3 commits into
mainfrom
spec/pp-arch-001-shared-block-consolidation
Closed

alfredodeza wants to merge 3 commits into
mainfrom
spec/pp-arch-001-shared-block-consolidation

Conversation

@alfredodeza

Copy link
Copy Markdown
Contributor

Summary

docs/specifications/PP-ARCH-001-MASTER.md — a companion spec to PP-QUANT-001
(#3418, PR #3420, epic #3421) addressing the axis that PP-QUANT-001 doesn't:
forward-pass logic, not quant-type dispatch, is what determines how many lines a
new architecture costs.

Measured (2026-09-17, origin/main @ 1d7dcc5e9): of the 1,678 lines #3418
itself counted for Qwen3-MoE, only ~85 are quant dispatch. The rest is forward
logic. And the sharpest finding: aprender already has a shared attention/FFN
layer analogous to llama.cpp's build_attn/build_moe_ffn —
gguf/inference/forward/attention.rs (25 functions) and ffn_block.rs (24) — but
the two newest architectures (forward_qwen35.rs 939 lines, forward_qwen3_moe.rs
321 lines) call zero of them, each reimplementing its own attention/softmax/
head-splitting inline. RoPE is independently implemented in ~25 files, attention math
in 20+, RMSNorm in 38.

Not all of it is avoidable: Qwen3.5/Next's hybrid DeltaNet math
(delta_rule_recurrence, causal_conv1d, gated_rmsnorm, apply_partial_neox_rope)
has no shared equivalent because nothing else needs it yet — the same situation
llama.cpp is in for any genuinely new op. The spec's exit criterion (§2.1) is scoped
to that distinction: zero reimplementation of operators that already exist, not
zero new code.

Phases (§3)

  1. Classify every forward function as shared / duplicate / novel (a contract, not
    hand-maintained — mirrors PP-QUANT-001's Phase 0 pattern)
  2. Design the composition convention + a slot for new operators
  3. Migrate starting from the proven Qwen2.5-Coder baseline (regression-checkable
    against docs/BEATS.md), then Qwen3-MoE, then Qwen3.5
  4. Prove it on a real new architecture (Qwen3-Next / Qwen3.8-Flash) landing without
    reintroducing the duplicate class

Placement

New milestone PP-ARCH-001 (created this session, distinct from the 06x-cadence
milestones) — no train-leaves-by deadline, because Phase 2 touches the same forward
paths as aprender's one proven GPU-parity receipt (Qwen2.5-Coder). PP-QUANT-001 rode
0.69 by operator decision despite a similar ask from #3418; this larger, riskier one
gets the dedicated cycle instead.

This PR is documentation only — no code changes.

Refs #3422 · Epic #3423 · Prerequisite: #3418 / PP-QUANT-001 (PR #3420, epic #3421)

🤖 Generated with Claude Code

#3422)

The axis #3418/PP-QUANT-001 doesn't cover: of Qwen3-MoE's 1,678 lines, only
~85 are quant dispatch. The rest is forward-pass logic that reimplements
attention/softmax/RoPE per architecture per backend, despite a working shared
layer already existing (attention.rs: 25 fns, ffn_block.rs: 24) that the two
newest architectures (Qwen3.5, Qwen3-MoE) call zero times.

Phases: 0 classify every forward fn as shared/duplicate/novel (contract, not
hand-maintained), 1 design the composition convention + a slot for genuinely
new operators (DeltaNet-class), 2 migrate starting from the proven
Qwen2.5-Coder baseline, 3 prove the exit criterion on a real new architecture
(Qwen3-Next) landing without reintroducing the duplicate class.

Placed on a new milestone (PP-ARCH-001, not a 06x train) since Phase 2 touches
the same forward paths as aprender's one proven GPU-parity receipt.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

§13.11 rung 1 — quorum shadow verdict

S13-SHADOW pr=3424 head=ebf50a857897b098373d75e4a0c4acdf64867623 verdict=REFUSE class=Q1 arm_rc=1

Shadow mode: this records a verdict and merges nothing. A refusal
to arm is not a block (§13 adds zero rows to §7) — the pull request is
exactly as green as it was.

#3422 is now a sub-issue of the umbrella #3418, not a sibling ticket. Epic
#3423 also tracks PP-QUANT-001 Phase 2/3, not just this document's phases.
Milestone renamed from the working title "PP-ARCH-001" to "Inference dispatch
& architecture consolidation" to reflect that it holds both consolidations'
dedicated-cycle work, not just this one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@alfredodeza

Copy link
Copy Markdown
Contributor Author

Ticket/epic consolidation (2026-09-17): this PR's ticket (#3422) is now a sub-issue of the umbrella #3418, not an independent top-level ticket. Epic #3423 (originally scoped to just this spec's phases) now also tracks PP-QUANT-001's Phase 2/3 — one epic for the one dedicated milestone. The milestone itself was renamed from the working title PP-ARCH-001 to Inference dispatch & architecture consolidation to reflect that it holds both consolidations, not just this one. Spec updated accordingly (§0 header, §6).

@noahgift

Copy link
Copy Markdown
Member

Triage from the release babysit session (aprender-ba): the guard-tree red here is the same one as on #3499 and is a PR-body rule, not the diff:

FAIL  no `ont-delta:` line. §11.1: a sweep PR closes with a delta,
FAILED: §11.1 — a sweep that ends in prose and nothing else is not finished.

gate is red only because guard-tree is. Fix = add an ont-delta: line to the PR body, then push (an empty commit is enough) or close/reopen — the guard reads the frozen pull_request event payload, so a body edit alone never re-runs it. GitHub reports the branch MERGEABLE against today's main, so nothing else is in the way. All three of your open PRs (#3499, #3420, #3424) are blocked by this same line; I have asked the ontology owner whether the §11.1 predicate is meant to reach spec PRs at all.

@noahgift

Copy link
Copy Markdown
Member

Update: the §11.1 predicate was the reach-too-far, not this PR. #3536 (PMAT-3535) merged at 20:04Z: the spec now names only the release spec (docs/specifications/APR-RELEASE-001-*.md) as a sweep sink, a *-MASTER.md design spec is the finding's home and not a sink, and check_pr_ont_delta.sh got the predicate self-test it never had. No body change needed — a rebase/update onto main (ce343c7 or later) re-runs guard-tree with the fixed guard.

@noahgift

Copy link
Copy Markdown
Member

Re-run on ebf50a8 (main merged in): the §11.1 ont-delta red is gone. One remaining red, this branch's body: guard-tree §6 R-2 — FAIL: non-closing ref(s) with no keep-open reason: #3418 #3421 #3422 #3423. Add a keep-open: #N <reason> line for each of the four (or close them with Closes #N where that is true), then push — a body edit alone never re-runs the guard. Everything else on the run is green.

@noahgift

Copy link
Copy Markdown
Member

closed by operator 1-day PR rule; reopen/rebase to resume.

No live owner session, red CI on the current head, not carried by main or any open integration PR. Linked issue: #3422 (open, milestone 0.74.0). Linked issues are not touched by this close.

Branch is NOT deleted: spec/pp-arch-001-shared-block-consolidation @ ebf50a857.

@noahgift noahgift closed this Sep 24, 2026
guyernest pushed a commit to guyernest/aprender that referenced this pull request Sep 29, 2026
…se spec, not every design spec — three maintainer PRs were red for a delta that did not exist; the predicate gets its self-test (Refs PMAT-3535) (paiml#3536)

* §11.1 + check_pr_ont_delta: the docs/specifications sink is the release spec, not every design spec; the predicate gets its self-test (Refs PMAT-3535)

Measured 2026-09-19 (aprender-ba): paiml#3499, paiml#3420 and paiml#3424 — a guard-regex
fix and two design specs — RED on guard-tree with `FAIL no ont-delta:
line`, each touching one file under docs/specifications/ and nothing else
§11.1 names. The guard was FAITHFUL to the sentence, which named
`docs/specifications/**` whole as a prose sink. A design spec is the
finding's home, not a sink a sweep writes into; the sink under that
directory is the train's own spec, where sweep findings are recorded.

Spec and guard move together: §11.1 names
`docs/specifications/APR-RELEASE-001-*.md` and says a `*-MASTER.md` design
spec is not a sweep; ONT_SWEEP_SINKS follows (the file, not the directory).

The predicate half had no self-test (all 15 rows fed check_body_text).
predicate_self_test — aprender-ba's leg, 10 rows: crate source, a
contract, ci.yml are not sweeps; night.yml, README, CLAUDE, the registry,
a derived baseline, the release spec are — chains into --self-test. The
falsifying row "a DESIGN spec is not a sweep" is want=1 and goes RED
(want=1 got=0) with the directory-wide sink restored, so the leg
discriminates. --self-test 15 + 10 passed; bashrs lint 0 errors.

Pmat-Ticket: PMAT-3535
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* §11.1 and the guard name the same bytes; the design-spec row is named as the criterion names it (Refs PMAT-3535)

Quorum round 1, lane 1: the spec said APR-RELEASE-001-*.md while ONT_SWEEP_SINKS said the exact file — 'verbatim' means the same string in both; and the row name carried a suffix the criterion did not. Criteria rewritten from the diff.

Pmat-Ticket: PMAT-3535
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* check_pr_ont_delta: say in predicate_row that sweep_reason takes a FILE of paths (Refs PMAT-3535)

Quorum round 2, lane 3 (flash) claimed, "measured", that predicate_row hands
sweep_reason the temp path itself so six rows fail with got=1. It does not:
sweep_reason reads the changed paths OUT of the file it is given
(`while IFS= read -r f … done < "$changed"`), which is the shape main()
hands it from --changed; predicate_row writes one path into a temp file and
passes the file. Measured on this head, `bash scripts/check_pr_ont_delta.sh
--self-test`: self-test 15 passed, 0 failed; predicate self-test 10 passed,
0 failed — and with the directory-wide sink restored exactly one row
(a DESIGN spec is not a sweep) goes want=1 got=0. The claim was a misread of
the function's contract; the comment now states that contract where the
misread happened, so the next reader does not need to trace it.

Pmat-Ticket: PMAT-3535
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* audit: quorum-PMAT-3535 round 3 AGREED 3/3 on ad99389 (Refs PMAT-3535)

Round 1: two exactness findings (the row name, the sink spelled the same in spec and guard), both taken. Round 2: one lane misread sweep_reason's file argument; refuted by the measured self-test and the contract stated in a comment.

Pmat-Ticket: PMAT-3535
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Noah Gift <noah@paiml.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:docs Docs, spec or changelog work (derived rule, #4159) needs-owner Open work with no live owner — 0.70 batch triage; pick it up and reassign

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants