Some checks failed
build-images / web (push) Has been cancelled
vision2026-ci / Python SDK resource tests (push) Has been cancelled
build-images / api (push) Has been cancelled
build-images / worker-gpu (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Has been cancelled
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Has been cancelled
codeql / Analyze (javascript-typescript) (push) Has been cancelled
codeql / Analyze (python) (push) Has been cancelled
perf / API hot-path micro-smoke (budgeted) (push) Has been cancelled
perf / Desktop engine crates (release build check) (push) Has been cancelled
vision2026-ci / API phase modules (ruff + pytest) (push) Has been cancelled
vision2026-ci / Alembic upgrade + drift check (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Has been cancelled
Paid, hosted product at menivor.com, now retired as a company project. Fresh squashed history of the cleaned working tree (secret-scanned, no .env, no customer data, no outreach logs). Built on MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
62 lines
1.9 KiB
Rust
62 lines
1.9 KiB
Rust
//! AP0 acceptance gate: 1,000,000 random transfers must conserve supply, keep
|
|
//! double-entry + non-negativity, and rebuild-from-journal == live projection.
|
|
//!
|
|
//! Ignored by default (it is the heavy gate); run explicitly, ideally release:
|
|
//! cargo test -p mint-ledger --release --test gate_million -- --ignored --nocapture
|
|
|
|
mod common;
|
|
|
|
use common::*;
|
|
use rand::rngs::StdRng;
|
|
use rand::{Rng, SeedableRng};
|
|
|
|
#[tokio::test]
|
|
#[ignore = "1M-transfer acceptance gate; run explicitly (prefer --release)"]
|
|
async fn million_transfer_conservation_gate() {
|
|
const ACCOUNTS: usize = 64;
|
|
const STEPS: usize = 1_000_000;
|
|
|
|
let ledger = deterministic_ledger();
|
|
let openings: Vec<i64> = (0..ACCOUNTS).map(|i| (i as i64 + 1) * 1_000_000).collect();
|
|
let (ids, opening_total) = seed_accounts(&ledger, &openings).await;
|
|
|
|
let mut rng = StdRng::seed_from_u64(0xA170);
|
|
let mut stats = StormStats::default();
|
|
for i in 0..STEPS {
|
|
let from = rng.random_range(0..ACCOUNTS);
|
|
let to = rng.random_range(0..ACCOUNTS);
|
|
let amount = rng.random_range(1i64..2_000_000);
|
|
apply_step(
|
|
&ledger,
|
|
&mut stats,
|
|
&ids[from],
|
|
&ids[to],
|
|
amount,
|
|
format!("m-{i}"),
|
|
)
|
|
.await;
|
|
}
|
|
|
|
assert_eq!(
|
|
live_total(&ledger, &ids).await,
|
|
opening_total,
|
|
"conservation after 1M transfers"
|
|
);
|
|
assert!(
|
|
min_available(&ledger, &ids).await >= 0,
|
|
"non-negativity after 1M"
|
|
);
|
|
let journal = ledger.store().journal_snapshot();
|
|
assert_double_entry(&journal);
|
|
assert_eq!(journal_delta_total(&journal), opening_total);
|
|
assert_rebuild_matches_live(&ledger).await;
|
|
|
|
eprintln!(
|
|
"1M gate: applied={} insufficient={} invalid={} journal_rows={}",
|
|
stats.applied,
|
|
stats.insufficient,
|
|
stats.self_or_invalid,
|
|
journal.len()
|
|
);
|
|
}
|