feat(proof): snapshot journal payouts and listed-op flop traces - #231
feat(proof): snapshot journal payouts and listed-op flop traces#231echobt wants to merge 2 commits into
Conversation
Emit paths now call snapshot_durable and propagate journal errors instead of empty maps. Training success requires a retained compute trace; artifact fingerprints hash file bytes. Co-authored-by: Mathis <echobt@users.noreply.github.com>
echobt
left a comment
There was a problem hiding this comment.
Review (Développeur)
Verdict: looks directionally right for the payout-journal + listed-op FLOPs goal. Do not merge to main without Mathis go (base is the checkpoint branch; no deploy / set_weights).
What looks good
- Fail-closed boot on
list_durable()/snapshot_durable— no silent empty store. store_runs/store_scoresreturnResultinstead of swallowing into{}.- Migration 0032 unique
submission_digestfor idempotent retries (0031 sequence note is clear). - Listed-op compute trace + controller twin
flop_totalrefusing unlisted ops / untrustedflops_used. - Docs honesty: not full recipe reproduction; no automatic emission loop;
can_score ≠ payment.
Nits / follow-ups
- BYOK lock (Mathis 2026-09-05): miner brings the pod; master must not auto-rent Lium. “Enable bounded live Lium ≤$30” as next step conflicts with that lock unless reframed as miner-paid / miner-owned compute. Prefer BYOK submit locator over master rent.
- Confirm runtime CI green before any merge consideration (contract was green earlier; runtime was still pending).
- Concurrent
proof_topic_runlast-writer-wins is called out — fine for v1; track if multi-validator scoring lands. - Stack: PR targets
checkpoint/proof-production-readiness-20260907, notmain— rebase/PR-to-main plan still needed when Mathis wants it.
Greptile: leave for bot; I won’t self-merge.
|
@greptileai review |
Greptile SummaryThis change adds FLOP trace accounting and submission-digest uniqueness, but three failures need correction before merge: unknown operations can undercount compute, controller-side validation is missing the evidence required to recompute the eval total, and historical duplicate digests can stop an upgrade. Confidence Score: 2/5Not safe to merge: compute-budget evidence can be understated, controller verification is not independently enforceable, and valid existing database data can prevent deployment upgrades. Three independently reproduced failures affect compute-evidence integrity and upgrade reliability. Files Needing Attention: eval/src/proof_eval/compute_trace.py, eval/src/proof_eval/cli.py, crates/proof-research/src/flops.rs, and crates/db/migrations/0032_proof_submission_digest.sql.
What T-Rex did
|
| if _looks_compute(name): | ||
| raise ContractError(f"unlisted compute op: {name}") | ||
| return 0 |
There was a problem hiding this comment.
The verifier accepts unrecognized operation names as zero-cost once a known compute operation is present. A trace containing a 48-FLOP aten::mm plus a large aten::linear is accepted with the same 48-FLOP total in both the Python verifier and Rust implementation. This allows submitted training evidence to understate compute consumption and pass the compute-budget gate with an invalid total.
Artifacts
- This script runs the Python verifier and Rust controller parity implementation against baseline and mixed traces; it demonstrates the executable reproduction used for the finding.
- The baseline run invoked both implementations with only `aten::mm`; each returned 48 FLOPs with exit code 0, establishing the comparison total.
- The reproduction run added a large `aten::linear` operation to the 48-FLOP matrix multiplication trace; both implementations still returned 48 and exited successfully, confirming understated totals.
| counted = verify_trace(harness.pop("compute_trace")) | ||
| if counted != harness.pop("eval_flops"): |
There was a problem hiding this comment.
Keep Controller Trace Evidence
The eval CLI verifies compute_trace locally, then removes both it and eval_flops before serializing the metrics document. The controller therefore receives neither the operation list nor the claimed total, and has no production call to recompute FLOPs. A locally produced metric can be accepted without the intended independent controller verification.
Artifacts
- This executable invokes the repository CLI scoring handoff with a traced harness payload and inventories Rust `flop_total` references, showing the exact evidence expected before serialization.
- The executed CLI output shows both trace and FLOP count were present before encoding but absent from the emitted harness, proving the controller receives neither.
- The executed Rust test command passed all three `proof-research` FLOP tests, showing the recomputation function exists while the handoff probe shows no production caller.
| CREATE UNIQUE INDEX proof_submission_freeze | ||
| ON proof_submission ((document->>'submission_digest')) | ||
| WHERE coalesce(document->>'submission_digest', '') <> ''; |
There was a problem hiding this comment.
If an upgrading database contains historical rows with the same non-empty submission digest, this migration's unique-index creation fails. The previous schema permits those rows; applying the migration to two valid duplicate records leaves the index absent and aborts the upgrade. Reconcile or explicitly reject duplicate groups before creating the unique index.
Artifacts
- Runs PostgreSQL 16, applies the actual 0031 and 0032 migrations, and compares duplicate-data failure with reconciled-data success; it confirms that unreconciled duplicates block the upgrade.
- Captured output from executing the reproduction script shows the duplicate-key index failure and then successful index creation after one duplicate is removed; it confirms the reported upgrade blocker.
* feat(proof): stub-win sim scores against sealed baseline Emit harness metrics relative to the sealed vector when PROOF_FORCE_SIM and PROOF_SIM_STUB_WIN are set, so staging submits can reach awaiting_admin. Skill-only sim stays NLL>=1.0. Co-authored-by: Mathis <echobt@users.noreply.github.com> * test(proof): probe both staging topics on droplet :80 Prefer 159.223.159.205/challenge/proof (ready sim) over the stale staging.api Lium instance. Submit both open topic ids. Co-authored-by: Mathis <echobt@users.noreply.github.com> * docs(proof): record staging sim submit→score (rejected vs seal) Live 201 on dt-no-ib-v0 and muon-vs-adamw-10m-v0 against 159.223.159.205; default sim misses the ~0.29 NLL floor. Co-authored-by: Mathis <echobt@users.noreply.github.com> * docs(staging): point proof probe at droplet sim host Co-authored-by: Mathis <echobt@users.noreply.github.com> * feat(proof): sealed-relative sim under force_sim Option A: Sim + sealed baseline always uses sim_win_document. No extra host env. Do not reseal (option B is ops-owned). Co-authored-by: Mathis <echobt@users.noreply.github.com> * test(proof): lock sealed-relative sim inequalities Skill 0.95 (StubScorer::win) still NLL>=1.0 vs a 0.29 seal. Option B reseal is paused; do not reseal from this lane. Co-authored-by: Mathis <echobt@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Mathis <echobt@users.noreply.github.com>
HOLD (Mathis FINAL, 2026-09-07)
X-Lium-Api-Key/ miner-paid pod). Do not rent on the masterLIUM_API_KEY.GET https://lium.io/api/pods→ 0 pods. Nothing to terminate. No rent was created this session.LIUM_LIVE_WRITESwas never implemented.set_weightswithout Mathis go.Summary
Finish the missing payout-journal integration on
checkpoint/proof-production-readiness-20260907and add independently recomputed compute traces. Proof/Bounty stay 8000/2000 bps. No merge to main, no production deploy, no on-chainset_weights.Payout / durability
emit_epoch_from_storecallsstore.snapshot_durable().await?on every emission and propagates journal errors.store_runs/store_scoresreturnResultand no longer swallow failures into empty maps. Journaled sync readers still refuse.bins/proof-challengereloads vialist_durable(); a failed snapshot is a boot error, not a silent empty store.proof_submission_id_seq. Do not replay 0031 on an already-migrated env.submission_digestmakes identical retries idempotent. Concurrentproof_topic_runupdates remain last-writer-wins. Network loss during COMMIT is still untested.Reproduction / FLOPs
mm/addmm/bmm/ math SDPA). Unlisted compute-shaped ops refuse rather than undercount.proof_research::flop_totalrecomputes the same total from the retained op list. A suppliedflops_usedis never trusted.proof-eval score|baselinestill refuses success withoutPROOF_TRAINING_EVIDENCE_FILEcarrying a matching retained trace.eval/baselines/adamw.pyis a parameter lock, not executable training.artifact_fingerprintnow hashes file bytes (sorted name + SHA-256), not the directory path.proof-measure64 MiB tar cap;proof-research16 MiB / 1 MiB retained-artifact caps).The v1 binary still has no automatic emission loop.
can_scoreis not payment.Greptile
@greptileai reviewTest plan
Targeted executables only (not a full workspace re-run). Disposable Postgres: labeled
cortex_proof_payout_ed26on localhost:55432, isolatedbase_test_*schemas viadb::test_pool.SQLX_OFFLINE=truefor compile.proof-challengelib: 6 passed, 1 ignored (journal path then run with--ignored: pass)proof-storelib: 4 passedproof-store--test durability -- --ignored: pass (incl. digest retry)proof-http--lib committed_terminal -- --ignored: passproof-research --lib flops: 3 passedcargo fmt --all -- --checkcargo clippy -p proof-challenge -p proof-store -p proof-research -p proof-challenge-bin --all-targets -- -D warningstest_contract.py+test_compute_trace.py(except torch collector): 34 passed, 1 deselectedcargo test --workspace: not re-runConnected (session secrets via
/tmpenv-file; never committed):has_astra=true,astra_models_count=27,astra_judge=ok(synthetic ack, not science)--preflightearlier: GET-only, found RTX 4090 at 0.32 USD/h, refused rent (live_writes_enabled=false, exit 2).GET /podson the master key → 0. No DELETE needed. Live Lium work stopped. Miner BYOK only.Risk
Emission helpers now fail closed on journal errors instead of paying from an empty in-process cache. 0032 unique digest can reject sloppy test rows that reused one digest; production freeze identities are already unique. No chain submit. Eval image pin is unchanged (candidate digest is still not a prod pin).
Naming
I did not rename
BASE_*environment variables, deployed host paths(
/opt/base,/run/base, …), GHCRbaseintelligence/basepackage names, orbase-*-v1cryptographic domain tags, unless this PR’s purpose is a coordinatedcutover documented in
docs/NAMING.md.