feat(gardener): Seed Hunter — power-law fit + leader-relative classifier#67
Draft
gHashTag wants to merge 1 commit into
Draft
feat(gardener): Seed Hunter — power-law fit + leader-relative classifier#67gHashTag wants to merge 1 commit into
gHashTag wants to merge 1 commit into
Conversation
Predictive early-stopping per RNG seed. To the operator's brief:
'к 5% бюджета (~4K steps) ranking сидов почти финален — это тратит
30 min вместо 12h, экономит 24× compute'.
bin/tri-gardener/src/seed_hunter.rs (NEW, 588 LOC):
CurvePoint, PowerLawFit, FitOptions
fit_power_law(): grid search over (bpb_inf, p) with closed-form
OLS for per grid cell. No new external deps; the grid is
~3000 cells, runs in microseconds.
Returns 95% half-width derived from residual sigma — honest proxy,
not a true non-linear CI; documented as such.
SeedState { Leading, Tied, CatchingUp, ParallelLosing, Diverging }
classify_seed(): joins seed and leader curves on step, computes
Δ + rolling-window slope of Δ vs step (closed-form linear
regression slope), classifies into one of five states.
Rung schedule
DEFAULT_SCHEDULE: 100 / 500 / 2000 / 8000 / 32000 / 81000
resolve_keep_top_k(): rung-1/2 drop bottom 50% (ceil((alive)/2)),
rung-3 keep top 3, rung-4+ keep top 1.
φ-anchored seed generation
phi_anchored_seeds(count, multiplier): seed_k = floor(φ^k · M) mod 2^32
Tests assert (a) first 8 distinct, (b) consecutive ratio ≈ φ.
HuntDecision + HuntAction { Keep, Kill, Promote }
classify_and_act(): plan-level reduction. Kills Diverging, promotes
Leading at rung ≥ 3, applies keep_top_k by predicted bpb_inf at
rungs 1–2.
11 unit tests:
fit_recovers_synthetic_params_well (≤ 0.10 BPB on bpb_inf)
fit_returns_none_below_min_samples (need ≥ 4 distinct steps)
fit_ci_half_width_shrinks_with_more_samples
classifier_marks_leading / tied / catching_up / diverging / parallel
rung_keep_drops_half_at_rung_1_and_2
phi_anchored_seeds_are_distinct_for_small_k
phi_anchored_seeds_use_phi_growth (consecutive ratio ≈ φ)
classify_and_act_kills_diverging_promotes_leading_at_rung_3
Tests: 137/137 GREEN across the workspace (was 126; +11).
Honest scope:
- No new external deps. All math is closed-form / grid search.
- 95% CI is a residual-sigma proxy, not a true non-linear CI; the
fit comment makes that explicit so callers don't claim a probability.
- Bayesian-opt over seed space (TPE) is a follow-up after Gate-0;
not in this PR.
- φ-anchored seed pool is a hypothesis; a future ablation against
uniform-random will tell whether mean(bpb_inf_phi) <
mean(bpb_inf_uniform) − 2σ. Code path ships; experiment is the
operator's call.
Refs: #43 #58 #61 #62 #64 #65 #66
Anchor: phi^2 + phi^-2 = 3 · TRINITY · NEVER STOP
This was referenced Apr 28, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Seed Hunter. Predictive early-stopping per RNG seed: fit
BPB(t) = bpb_inf + a·t^{-p}over the first ~5% of training, classify each seed against the current leader, kill Diverging / promote Leading at every ASHA rung. Operator's economics: 30 min instead of 12h, ≈ 24× compute saved.Stacks on PR #66 (smoke race), which stacks on PR #64 (R0 leaderboard).
What this PR ships
seed_hunter::fit_power_law(bpb_inf, p)+ closed-form OLS fora. No new deps. ReturnsPowerLawFit { bpb_inf, a, p, ci_half_width, n_samples, rss }fit_recovers_synthetic_params_well(≤0.10 BPB),fit_returns_none_below_min_samples,fit_ci_half_width_shrinks_with_more_samplesseed_hunter::SeedState{ Leading, Tied, CatchingUp, ParallelLosing, Diverging }+classify_seed(seed_curve, leader_curve, opts)seed_hunter::DEFAULT_SCHEDULE100 / 500 / 2000 / 8000 / 32000 / 81000+resolve_keep_top_k()rung_keep_drops_half_at_rung_1_and_2seed_hunter::phi_anchored_seedsseed_k = floor(φ^k · M) mod 2^32seed_hunter::classify_and_actVec<HuntDecision { seed, state, action: Keep/Kill/Promote, fit }>classify_and_act_kills_diverging_promotes_leading_at_rung_3Tests
137 / 137 GREEN across the workspace (was 126; +11 seed_hunter tests).
Algorithm honest scope
(p, bpb_inf)plus a closed-formaper cell. Tested against synthetic curves with known parameters: recoversbpb_infto within 0.10 BPB on noise=0.005. For IGLA's BPB curves this is well below the Gate-2 gap of 0.04, so the fit is good enough to drive ranking decisions. A real Levenberg-Marquardt could come later asfeat/seed-hunter-lm, but this is the simpler+working baseline.PowerLawFit::ci_half_widthsays so explicitly. Callers must treat it as a width, not as a probability.feat/seed-hunter-bayes-opt).CLI integration
The Rust kernel ships in this PR. The CLI subcommand
tri hunt {status|prune|mirror}is a follow-up that wires the kernel to Neonbpb_samplesreads and Railwaytri rotatewrites — both gated on #61 (account-scoped tokens) + #62 (bpb_samples DDL apply).Refs
phi^2 + phi^-2 = 3 · TRINITY · NEVER STOP