Skip to content

Add Evolution-Strategies reference tier (EGGROLL W1) - #541

Merged
gstoner merged 3 commits into
mainfrom
agent/eggroll-w1-es-reference
Aug 9, 2026
Merged

gstoner merged 3 commits into
mainfrom
agent/eggroll-w1-es-reference

Conversation

@gstoner

@gstoner gstoner commented Aug 9, 2026

Copy link
Copy Markdown
Owner

What

W1 of the gradient-free / Evolution-Strategies track: the host-free reference tier (Decision #28 tier-1) for EGGROLL (Evolution Strategies at the Hyperscale, arXiv:2511.16652), plus the proof-backed design plan and the operator-improvement catalog it drives.

New: python/tessera/stdlib/es.py

  • population_forward — batched-LoRA forward x·Mᵀ + (σ/√r)·sign·(x·B)·Aᵀ (Thm 1, exact)
  • es_update — materialization-free factored update Σ f_i·sign_i·A_iB_iᵀ/√r/N (Thm 2, exact)
  • low_rank_perturbation / reconstruct_factors — member-keyed factors
  • fitness_shaping / centered_rank / antithetic_signzscore delegates to rl.normalize_group_advantages, so ES and GRPO share one normalizer (operator win O6)

Three audit-forced contracts honored by construction:

Tests: tests/unit/test_es_reference.py — 16/16 green

Two oracle families mirroring the verify_synthesized_* split (exact vs statistical, never conflated):

  • A (exact, any r): forward identity, update = naive sum, antithetic-aware rank (Thm 3 refined: min(⌈N/2⌉·r, out, in)), member-keyed RNG, fp32-accum contract, G4 fail-closed
  • B (statistical): moment match (Cov(E)=I at r=1), unbiased-on-linear, bias-needs-∇³f, GRPO-normalizer reuse

mypy clean (ratchet=0 held); 35 existing governance + stdlib tests unaffected.

Docs: docs/audit/compiler/EGGROLL_SUPPORT_PLAN.md

Proof-backed contract for the W2 op es_low_rank_correction, the three corrections verification forced (antithetic rank, mean-field score dropped — it's near-orthogonal to the gradient at low r and breaks the factorization, G6 downgraded — CLT makes the quantile threshold well-calibrated), and a 12-item catalog of improvements to existing operators (P0: numeric_policy carrier below Graph-IR, saturating requantize, shared-operand batched GEMM).

Scope

Reference tier only. The Graph-IR op + op_catalog/primitive_coverage registration land with W2 — registering the op now would declare a contract with no consumer (Decision #29). Generated test_coverage doc regenerated for the new normalize_group_advantages reference.

🤖 Generated with Claude Code

Host-free reference tier (Decision #28 tier-1) for the gradient-free /
Evolution-Strategies track, plus the design plan and operator-improvement
catalog it drives.

  python/tessera/stdlib/es.py
    - population_forward: batched-LoRA forward x·Mᵀ + (σ/√r)·sign·(x·B)·Aᵀ (Thm 1)
    - es_update: materialization-free factored update Σ f_i·sign_i·A_iB_iᵀ/√r/N (Thm 2)
    - low_rank_perturbation / reconstruct_factors: member-keyed factors
    - fitness_shaping / centered_rank / antithetic_sign; zscore delegates to
      rl.normalize_group_advantages so ES and GRPO share one normalizer (O6)

Three audit-forced contracts are honored by construction:
  - G2 member-keyed RNG: factors fold in (epoch, pair) via rng.RNGKey.fold_in,
    never the device rank — orthogonal to Decision #18's per-rank stream
  - G4 sigma is a required semantic (fails closed)
  - I6 fp32/s32 accumulation (Decision #32); bf16 accum rejected

tests/unit/test_es_reference.py: two oracle families (16/16) — A1–A5 exact
(any r) + G4 fail-closed, B1–B3 statistical (expectation). mypy clean.

docs/audit/compiler/EGGROLL_SUPPORT_PLAN.md: proof-backed op contract for the
W2 op es_low_rank_correction, the corrections verification forced (Thm 3
antithetic rank, mean-field score dropped, G6 downgraded), and a 12-item
catalog of improvements to existing operators (P0: numeric_policy carrier,
saturating requantize, shared-operand batched GEMM).

Reference tier only — the IR op + primitive_coverage registration land with W2
(a declaration needs a consumer, Decision #29).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1f7a865296

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/audit/compiler/EGGROLL_SUPPORT_PLAN.md
Comment thread python/tessera/stdlib/es.py
Comment thread python/tessera/stdlib/es.py Outdated
Comment thread docs/audit/compiler/EGGROLL_SUPPORT_PLAN.md
gstoner and others added 2 commits August 9, 2026 15:58
test_audit_docs.py requires every live compiler doc to be routed in
docs/audit/compiler/README.md and every audit_role:plan doc to link the
compiler map + INTEGRATED_COMPILER_PLAN.md. Add the routing header to the plan
and a catalog entry to the index.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…d outcome

Codex review findings on #541:

- P2 (accum): es_update accepted accum="s32" but always used float64, so the
  advertised integer lane silently aliased fp32. Now s32/int32 raise
  NotImplementedError (the EGG integer lane is W-later); only fp32/f32 execute.
- P2 (dtype): _np_storage silently widened fp16/bf16 to float32. Now normalizes
  through canonicalize_dtype and maps to real numpy storage (np.float16,
  ml_dtypes.bfloat16), rejecting unsupported spellings (Decision #21a).
  Tests added: s32 rejected, fp16/bf16 storage preserved, fp8 rejected.
- P1 (backend sync): the shared es_low_rank_correction contract + fp32/s32
  accumulation policy now records a per-architecture outcome in each backend
  queue under sync key EGGROLL-ES-LOWRANK-2026-08-09 (AGENTS.md sibling-backend
  rule); the plan doc names the key.

Regenerated test_coverage (dtype-tag column) for the new dtype test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gstoner
gstoner merged commit c681d51 into main Aug 9, 2026
18 checks passed
@gstoner
gstoner deleted the agent/eggroll-w1-es-reference branch August 11, 2026 01:04
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