Skip to content

feat(zenpicker): i8 vs f16 agreement example + load_meta_picker_v0_1 + lib.rs additions#76

Closed
lilith wants to merge 1 commit into
mainfrom
feat/zenpicker-i8-agreement
Closed

feat(zenpicker): i8 vs f16 agreement example + load_meta_picker_v0_1 + lib.rs additions#76
lilith wants to merge 1 commit into
mainfrom
feat/zenpicker-i8-agreement

Conversation

@lilith

@lilith lilith commented May 10, 2026

Copy link
Copy Markdown
Member

Summary

Single commit on top of the merged three-crate rename. Adds two zenpicker examples and lib.rs additions.

Files

  • `zenanalyze/zenpicker/examples/i8_vs_f16_agreement.rs` — measures argmin agreement rate and max raw-output drift between i8-quantized and f16 bakes on the held-out 20% feature set
  • `zenanalyze/zenpicker/examples/load_meta_picker_v0_1.rs` — loader example
  • `zenanalyze/zenpicker/src/lib.rs` — 242 lines of additions

Test plan

  • `cargo run --release -p zenpicker --example i8_vs_f16_agreement` against the validation TSV
  • `cargo run --release -p zenpicker --example load_meta_picker_v0_1`
  • Confirm lib.rs additions pass tests + clippy

@lilith lilith self-assigned this May 10, 2026
@lilith lilith force-pushed the feat/zenpicker-i8-agreement branch from 8fc1f8f to 3ed2ff4 Compare June 4, 2026 01:58
@lilith

lilith commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

Rebased onto current main (66d08f6) — NOT obsolete; the lib.rs additions are still novel.

Obsolescence assessment (per-piece, vs current origin/main zenpicker/src/lib.rs)

Piece Verdict Evidence on main
MetaPicker.family_at_output field + family_at_output() accessor still-novel main's MetaPicker struct has only predictor: Predictor<'b> — no cache field, no accessor
Subset-aware validate_family_order (parse + length check, subset OK) still-novel main still does exact-match if raw == ALL_LABELS_CSV { Ok } else { Err(FamilyOrderMismatch) }
parse_family_csv helper + 4 unit tests still-novel absent from main
Subset-aware pick (maps argmin idx through the bake's order) still-novel main's pick still does `pick.map(
pick_with_time_cost (size/time tradeoff via ArgminOffsets + ScoreTransform::Exp) still-novel absent from main
examples/i8_vs_f16_agreement.rs, examples/load_meta_picker_v0_1.rs still-novel zenpicker/examples/ does not exist on main

Nothing here is superseded — main's MetaPicker is still the pre-subset, exact-match version. So this is a "still applicable, needs adaptation" PR, not a close-candidate.

What changed during the rebase (916 commits behind)

Single API adaptation, driven by the zenpredict 0.2.0 change that made Model own its data and Predictor/MetaPicker borrow it:

  • MetaPicker::new(model: Model<'b>)MetaPicker::new(model: &'b Model). Conflict was confined to MetaPicker::new (this PR rewrote its docstring+body for the family_at_output cache; main independently changed the signature to &'b Model). Resolution: kept main's &'b Model borrow signature, folded in this PR's cache-on-construction logic (Predictor::new(model) and model.metadata()/.n_outputs() are both shared borrows, so no borrowck issue).
  • Both examples updated to MetaPicker::new(&model) (Models bound before the pickers; they outlive the borrows).
  • One clippy unusual_byte_groupings fix on the example RNG seed (0xC0FFEE_42DE_AD150x00C0_FFEE_42DE_AD15), surfaced now that --all-targets checks the examples.
  • cargo fmt reflow of the new code to current rustfmt.

The bake feature is not referenced anywhere in this PR, so no bakeadvanced migration was needed.

Green gate (local, on the rebased commit 3ed2ff4)

cargo build   -p zenpicker                          -> ok
cargo test    -p zenpicker --lib                     -> ok (10 passed; incl. 5 new: parse_family_csv_* x4 + time_cost_table_uses_codec_family_index)
cargo clippy  -p zenpicker --all-targets -- -D warnings -> ok
cargo build   -p zenpicker --examples                -> ok
cargo fmt     -p zenpicker --check                   -> ok

Force-pushed (lease) to feat/zenpicker-i8-agreement; tip is now 3ed2ff4d4d1b9db6c030ca651845055b5f1c4cd5, 1 commit on top of main (66d08f6), only the 3 in-scope files (+458/-19).

Note (not addressed, out of scope): i8_vs_f16_agreement.rs's header comment says it "falls back to a 1000-row synthetic sample if the TSV is absent" but the body always uses 5000 synthetic samples and never reads the TSV — pre-existing doc/code drift in the original commit. Both examples also point at absolute /home/lilith/oracle-d2-store/... bake paths, so cargo run needs those artifacts present; they build fine without them.

@lilith

lilith commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

Closing without merging.

Decision: per-request family restriction is the caller's job via the existing AllowedFamilies mask, not the picker's. Bakes stay canonical — all 6 families in CodecFamily::ALL order, a fixed-shape function — and the caller restricts the choice set. The subset-bake machinery this PR adds (family_at_output, subset-aware validate_family_order / pick, parse_family_csv) buys non-canonical subset bakes, a flexibility we've decided not to take on. pick_with_time_cost is orthogonal/speculative (no time-aware meta-picker exists yet).

Branch feat/zenpicker-i8-agreement @ 3ed2ff4 (rebased onto 0.2.0, green) is preserved if any piece is revived — note the i8-vs-f16 agreement example there is a useful validation harness once its absolute /oracle-d2-store/... paths are fixed.

@lilith lilith closed this Jun 4, 2026
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