Publish full finite views and backend-bound CUDA verifier
Browse filesAll25096 finite views, verified source hash; explicit baseline/prefix verifier with before/after runtime/kernel pins and directly recomputed proof requirement. Includes actual Molab SM120 build exit0 receipt for the immutable base package. Updated verifier Molab build/full GPU parity and matched speedup remain pending.
MOLAB_NATIVE_V2_PACKAGE.md
CHANGED
|
@@ -40,3 +40,19 @@ subsequent performance measurements for this project are restricted to Molab.
|
|
| 40 |
|
| 41 |
The reduced smoke subset was cancelled by the user on 2026-10-01 at 16:31;
|
| 42 |
the active scope remains the complete native generator and normative workload.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
The reduced smoke subset was cancelled by the user on 2026-10-01 at 16:31;
|
| 42 |
the active scope remains the complete native generator and normative workload.
|
| 43 |
+
|
| 44 |
+
## Verifier update after the immutable package build
|
| 45 |
+
|
| 46 |
+
The separately published `verify_cuda_full_hashes.rs` and
|
| 47 |
+
`native_full_hash_backend_patch_20261002.json` add explicit trailing
|
| 48 |
+
`--backend=baseline|prefix`, pin both CUDA runtime and kernel before load and
|
| 49 |
+
after verification, and refuse reuse of indirect or mismatched proofs. Two
|
| 50 |
+
CPU correctness tests and independent source review passed. This updated
|
| 51 |
+
verifier requires a new Molab build and binary hash; the immutable package and
|
| 52 |
+
its earlier successful Molab build contain the baseline-only verifier.
|
| 53 |
+
Preserve those historical source and runtime hash receipts. The published
|
| 54 |
+
`views.jsonl` has SHA-256
|
| 55 |
+
`28d8e41c9e9ad343c9e4040556072761d141dbc09bdb87bb2937ffb7419ca9fb`;
|
| 56 |
+
it supplies all 25,096 finite views for complete hash recomputation. Use the
|
| 57 |
+
already published `audit.json` and original normative source closure for the
|
| 58 |
+
independent full-bank verifier.
|
molab_native_v2_build_verified_20261002.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"gcc_version": "14.2.0",
|
| 3 |
+
"runtime_hash_entries": 15,
|
| 4 |
+
"required_native_exports_verified": true,
|
| 5 |
+
"remote_exit_receipt": "/marimo/native_tools/native_v2_build_exit.json",
|
| 6 |
+
"cuda_arch": "120",
|
| 7 |
+
"rustc_version": "1.97.1",
|
| 8 |
+
"runtime_hash_file": "/marimo/native_v2_reviewed_20261002/native_generator/build/runtime_SHA256SUMS",
|
| 9 |
+
"python_executed": false,
|
| 10 |
+
"matched_speedup_verified": false,
|
| 11 |
+
"cargo_version": "1.97.1",
|
| 12 |
+
"nvcc_version": "13.3.73",
|
| 13 |
+
"source_directory": "/marimo/native_v2_reviewed_20261002",
|
| 14 |
+
"schema": "molab_native_v2_build_verified_v1",
|
| 15 |
+
"log": "/marimo/native_tools/native_v2_build.log",
|
| 16 |
+
"build_exit": 0,
|
| 17 |
+
"observed_utc": "2026-10-02T20:38:42.4590775Z",
|
| 18 |
+
"build_complete_marker_observed": true,
|
| 19 |
+
"full_v2_epoch_verified": false,
|
| 20 |
+
"gpu_generation_launched": false,
|
| 21 |
+
"foreground_shell_pid": 15180,
|
| 22 |
+
"source_archive_sha256": "544f6ea8e4a52a90f57b662b76a2bd8575b20a7893234282d6f7f5704c9b86a8",
|
| 23 |
+
"gpu_correctness_verified": false
|
| 24 |
+
}
|
native_full_hash_backend_patch_20261002.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cli_backend": "trailing --backend=baseline|prefix",
|
| 3 |
+
"full_gpu_execution_verified": false,
|
| 4 |
+
"views_sha256": "28d8e41c9e9ad343c9e4040556072761d141dbc09bdb87bb2937ffb7419ca9fb",
|
| 5 |
+
"source_sha256": "1c24e45aeab43778339402d406cff072e9afa458a4c2d857699b0ebbe0d88472",
|
| 6 |
+
"finite_views": 25096,
|
| 7 |
+
"all_parent_and_primitive_hashes": 126631688,
|
| 8 |
+
"cpu_tests_passed": 2,
|
| 9 |
+
"runtime_and_kernel_pins_before_load_and_after_run": true,
|
| 10 |
+
"source": "verify_cuda_full_hashes.rs",
|
| 11 |
+
"schema": "native_full_hash_backend_patch_v1",
|
| 12 |
+
"peer_source_review": true,
|
| 13 |
+
"reusable_proof_requires_direct_recomputation": true,
|
| 14 |
+
"base_package_sha256": "544f6ea8e4a52a90f57b662b76a2bd8575b20a7893234282d6f7f5704c9b86a8",
|
| 15 |
+
"molab_patch_build_verified": false,
|
| 16 |
+
"views_bytes": 33257518
|
| 17 |
+
}
|
verify_cuda_full_hashes.rs
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use frontier_native_generator::{Matrix,cuda_bank::CudaBank,compact_bank::NeighbourHasher,holdout_views::sha};
|
| 2 |
+
use std::{path::Path,collections::BTreeMap,time::Instant};
|
| 3 |
+
fn take_backend(args:&mut Vec<String>)->Result<&'static str,String>{
|
| 4 |
+
let backend=if args.last().is_some_and(|s|s.starts_with("--backend=")){
|
| 5 |
+
match args.pop().unwrap().as_str(){"--backend=baseline"=>"baseline","--backend=prefix"=>"prefix",_=>return Err("unknown CUDA backend".into())}
|
| 6 |
+
}else{"baseline"};
|
| 7 |
+
if !(5..=7).contains(&args.len()){return Err("views.jsonl runtime-library kernel-library new-receipt.json [full-bank-directory [verified-full-hash-receipt]] [--backend=baseline|prefix] required".into());}
|
| 8 |
+
Ok(backend)
|
| 9 |
+
}
|
| 10 |
+
fn verify_reuse(proof:&serde_json::Value,views:&str,runtime:&str,kernel:&str,backend:&str)->Result<(),String>{
|
| 11 |
+
if proof["completed"]!=true||proof["hashes_recomputed_in_this_run"]!=true||proof["finite_views"]!=25096||proof["all_parent_and_primitive_hashes"]!=126631688||proof["views_sha256"]!=views||proof["runtime_sha256"]!=runtime||proof["kernel_sha256"]!=kernel||proof["bank_backend"]!=backend{return Err("complete recomputed digest parity receipt/source/runtime/kernel/backend drift".into());}
|
| 12 |
+
Ok(())
|
| 13 |
+
}
|
| 14 |
+
fn run()->Result<(),String>{
|
| 15 |
+
let mut args:Vec<_>=std::env::args().collect();let backend=take_backend(&mut args)?;
|
| 16 |
+
let output=frontier_native_generator::windows_path_policy::writable_target(Path::new(&args[4]))?;
|
| 17 |
+
if output.exists(){return Err("receipt already exists".into());}
|
| 18 |
+
let raw=std::fs::read(&args[1]).map_err(|e|e.to_string())?;
|
| 19 |
+
if sha(&raw)!="28d8e41c9e9ad343c9e4040556072761d141dbc09bdb87bb2937ffb7419ca9fb"{return Err("full finite views source drift".into());}
|
| 20 |
+
let mut groups:BTreeMap<usize,Vec<Matrix>>=BTreeMap::new();
|
| 21 |
+
for line in raw.split(|&b|b==b'\n').filter(|l|!l.is_empty()){
|
| 22 |
+
let v:serde_json::Value=serde_json::from_slice(line).map_err(|e|e.to_string())?;let n=v["n"].as_u64().ok_or("width absent")? as usize;
|
| 23 |
+
let mut matrix=Matrix::identity(n).map_err(str::to_owned)?;let values=v["packed_rows"].as_array().ok_or("rows absent")?;if values.len()!=n{return Err("row count mismatch".into());}
|
| 24 |
+
for (i,value) in values.iter().enumerate(){let mut limbs=[0u64;3];for byte in value.to_string().bytes(){if !byte.is_ascii_digit(){return Err("noninteger row".into());}let mut carry=(byte-b'0') as u128;for limb in &mut limbs{let result=*limb as u128*10+carry;*limb=result as u64;carry=result>>64;}if carry!=0{return Err("row overflow".into());}}matrix.rows[i]=limbs;}
|
| 25 |
+
groups.entry(n).or_default().push(matrix);
|
| 26 |
+
}
|
| 27 |
+
if groups.values().map(Vec::len).sum::<usize>()!=25096||groups.len()!=14{return Err("full finite-view scope mismatch".into());}
|
| 28 |
+
let runtime_sha=sha(&std::fs::read(&args[2]).map_err(|e|e.to_string())?);let kernel_sha=sha(&std::fs::read(&args[3]).map_err(|e|e.to_string())?);
|
| 29 |
+
let mut cuda=if backend=="prefix"{CudaBank::open_prefix(Path::new(&args[2]),Path::new(&args[3]),64,args.len()!=7)?}else{CudaBank::open(Path::new(&args[2]),Path::new(&args[3]),64,args.len()!=7)?};let started=Instant::now();let mut hashes=0u64;let mut states=0;let mut parity_receipt_sha=String::new();
|
| 30 |
+
if args.len()==7{let proof_raw=std::fs::read(&args[6]).map_err(|e|e.to_string())?;let proof:serde_json::Value=serde_json::from_slice(&proof_raw).map_err(|e|e.to_string())?;verify_reuse(&proof,&sha(&raw),&runtime_sha,&kernel_sha,backend)?;states=25096;hashes=126631688;parity_receipt_sha=sha(&proof_raw);}
|
| 31 |
+
else{for (n,matrices) in &groups{for batch in matrices.chunks(64){let actual=cuda.hashes(batch)?;for(matrix,got) in batch.iter().zip(actual){let mut index=0;NeighbourHasher::visit(matrix,|expected|{if got.get(index)!=Some(&expected){return Err(format!("CUDA digest mismatch n={n} state={states} variant={index}"));}index+=1;Ok(())})?;if index!=got.len(){return Err("CUDA variant count mismatch".into());}hashes+=index as u64;states+=1;}}println!("verified n={n} states={states} full_hashes={hashes}");}}
|
| 32 |
+
let mut membership_states=0;let mut train_comparisons=0;
|
| 33 |
+
if args.len()>=6{let directory=Path::new(&args[5]);let manifest_sha=sha(&std::fs::read(directory.join("bank_manifest.json")).map_err(|e|e.to_string())?);if manifest_sha!="db9741b1971e96011673d93605f9853e52f48695dca4fd905fadb10424bfaa6e"{return Err("independently verified complete bank drift".into());}cuda.load_verified(directory,&sha(&raw),&manifest_sha)?;
|
| 34 |
+
for matrices in groups.values(){for batch in matrices.chunks(64){if cuda.admit(batch)?.into_iter().any(|allowed|allowed){return Err("full bank failed to reject held-out finite view".into());}membership_states+=batch.len();}}
|
| 35 |
+
let cpu=frontier_native_generator::compact_bank::Bank::open_verified(directory,&sha(&raw),&manifest_sha)?;
|
| 36 |
+
for index in 0..56{let position=(index/14)*112+index%14;let plan=frontier_native_generator::RootPlan::new(frontier_native_generator::Split::Train,0,position,0,3700).map_err(str::to_owned)?;let matrix=frontier_native_generator::ordinary_walk(plan)?.matrix;let expected=cpu.admit(&matrix).is_ok();if cuda.admit(std::slice::from_ref(&matrix))?[0]!=expected{return Err("full bank train admission parity mismatch".into());}train_comparisons+=1;}
|
| 37 |
+
}
|
| 38 |
+
if sha(&std::fs::read(&args[2]).map_err(|e|e.to_string())?)!=runtime_sha||sha(&std::fs::read(&args[3]).map_err(|e|e.to_string())?)!=kernel_sha{return Err("CUDA library drift during verification".into());}
|
| 39 |
+
let receipt=serde_json::json!({"schema":"own_cuda_full_sha256_finite_views_parity_v2","completed":true,"bank_backend":backend,"runtime_sha256":runtime_sha,"finite_views":states,"all_parent_and_primitive_hashes":hashes,"widths":groups.keys().collect::<Vec<_>>(),"views_sha256":sha(&raw),"kernel_sha256":kernel_sha,"elapsed_seconds":started.elapsed().as_secs_f64(),"membership_verified":args.len()>=6,"hashes_recomputed_in_this_run":args.len()!=7,"digest_parity_receipt_sha256":parity_receipt_sha,"full_bank_rejected_finite_views":membership_states,"train_admission_comparisons":train_comparisons,"full_train_verified":false});
|
| 40 |
+
std::fs::write(&output,serde_json::to_vec_pretty(&receipt).unwrap()).map_err(|e|e.to_string())?;Ok(())
|
| 41 |
+
}
|
| 42 |
+
fn main(){if let Err(error)=run(){eprintln!("{error}");std::process::exit(1);}}
|
| 43 |
+
|
| 44 |
+
#[cfg(test)]mod tests{
|
| 45 |
+
use super::*;
|
| 46 |
+
#[test]fn explicit_backend_preserves_positional_scope(){
|
| 47 |
+
let base=vec!["bin","views","runtime","kernel","receipt"];
|
| 48 |
+
let mut args:Vec<String>=base.iter().map(|s|s.to_string()).collect();assert_eq!(take_backend(&mut args).unwrap(),"baseline");
|
| 49 |
+
args.extend(["bank".into(),"proof".into(),"--backend=prefix".into()]);assert_eq!(take_backend(&mut args).unwrap(),"prefix");assert_eq!(args.len(),7);
|
| 50 |
+
args.push("--backend=approximate".into());assert!(take_backend(&mut args).is_err());
|
| 51 |
+
}
|
| 52 |
+
#[test]fn reusable_proof_binds_actual_runtime_kernel_and_backend(){
|
| 53 |
+
let proof=serde_json::json!({"completed":true,"hashes_recomputed_in_this_run":true,"finite_views":25096,"all_parent_and_primitive_hashes":126631688,"views_sha256":"views","runtime_sha256":"runtime","kernel_sha256":"kernel","bank_backend":"prefix"});
|
| 54 |
+
assert!(verify_reuse(&proof,"views","runtime","kernel","prefix").is_ok());
|
| 55 |
+
for (runtime,kernel,backend) in [("other","kernel","prefix"),("runtime","other","prefix"),("runtime","kernel","baseline")]{assert!(verify_reuse(&proof,"views",runtime,kernel,backend).is_err());}
|
| 56 |
+
let mut legacy=proof.clone();legacy.as_object_mut().unwrap().remove("runtime_sha256");assert!(verify_reuse(&legacy,"views","runtime","kernel","prefix").is_err());
|
| 57 |
+
let mut indirect=proof.clone();indirect["hashes_recomputed_in_this_run"]=false.into();assert!(verify_reuse(&indirect,"views","runtime","kernel","prefix").is_err());
|
| 58 |
+
}
|
| 59 |
+
}
|