Repository navigation
Feat/new compiler - #92
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
…shutdown Replace per-process SIGINT/SIGTERM handlers with a centralized AbortController. All Bun.spawn calls now receive the abort signal, benchmark loops check isAborted() to break early, and the first Ctrl+C triggers graceful unwinding through finally blocks.
… at all sizes Replace hardcoded sample inputs with a configurable scaling system that fills each target input length with regex-matching content. Three strategies: repeat (tile template), extend (grow match portion), and pad-with-match (anchored template + filler). Each pattern in patterns.json now declares inputTemplate and scalingStrategy. All three providers use generateScaledInput() instead of static lookup tables. Output reports include scaling methodology, actual content lengths, and per-pattern strategy tables. Also improves memory measurement: separates command stderr from /usr/bin/time output for reliable RSS parsing, records data from non-zero exits (common with nested shell wrapping), and adds --no-memory flag support via BENCH_NO_MEMORY env var.
Use accurate compiler backend names (DFA/NFA) instead of version numbers (v1/v2) throughout benchmark configs, output generation, and type definitions for clarity in academic context.
Increase minRuns to 5 and maxRuns to 10 for better statistical significance. Add missing generateScaledInput imports to circom and noir providers. Add docs/ to gitignore.
Add compilerCommitHash and toolVersions fields to individual benchmark result files for reproducibility. Rename all provider identifiers from v1/v2 to DFA/NFA to better describe the algorithm difference. - Extend BenchmarkProvider interface with getCommitHash() and getToolVersions() - Move BenchmarkResult type from bench.ts to shared types.ts - Rename providers: circom-v1→circom-dfa, circom-v2→circom-nfa, noir-v2→noir-nfa - Update all type fields, config keys, CLI args, scripts, and README - Add compilerVersions aggregation to collect-results.ts
Remove ~120 lines of dead code: isOk, isErr, unwrap, unwrapOr, map, flatMap from errors.ts; runHyperfineBatch, measureSync, hashFile, proveAndVerify from utils. None had any callers in the codebase.
…code Create two new shared modules (exec.ts, project.ts) and centralize duplicated functions across 7 files (~19 duplicate instances removed): - execAsync/execCommand: unified in utils/exec.ts with configurable options (useNvm, errorFactory) to preserve each call site's behavior - wrapCommandWithNvm/getNvmWrappedCommand: unified with bashWrap option - getProjectRoot/getGitCommitHash: extracted to utils/project.ts - defaultMemoryStats: removed local copy from collect-results.ts - getToolVersions: Circom sync version centralized in hardware.ts - measureWitnessGeneration: promoted to shared utility in snarkjs.ts Net reduction: ~300 lines. No behavioral changes.
…teStats Variance was dividing by n (population variance) instead of n-1 (sample variance). With minRuns=5 this underestimates stddev by ~12%. Added n>1 guard to avoid division by zero on single measurements.
Validate git ref against a strict pattern and quote it in the shell command to prevent injection via a malicious benchmark.json value.
Rename remaining v1/v2 references in generate-outputs.ts comments and reductionPct parameter names to use DFA/NFA terminology, and update the module docstring in src/index.ts.
The PTAU file download performed no integrity verification after fetching a ~2GB file. Add streaming SHA256 verification for both fresh downloads and cached files, with automatic re-download on mismatch.
Replace the abstract class with direct interface implementation since all methods were abstract except an empty cleanup() that every provider overrides. Also consolidate NoirCircuitInput and MemoryStats into types.ts.
…benchmarks-package feat(benchmarks): add benchmarking suite for DFA vs NFA comparison
The linkage check stopped at maxMatchBytes-2, so when matchLength == maxMatchBytes the final transition was not tied to the rest of the path and a prover could jump straight into an accept state. Adds a forged witness regression test and regenerates the common circuits.
Lookup keys pack state + byte*257 + next*257^2, which stops being injective past 257 states. Detect real aliasing at codegen time and fail with a clear error instead of emitting an unsound circuit.
…cense placeholder
Merge prep for #92: 3.0.0-alpha.1, soundness fixes, migration guide
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Note
Replaces the old Rust compiler and extensive Circom tests with a new Bun/TypeScript scripts suite (gen-regex, gen-inputs), shared utilities, and Jest-based tests.
circom/scripts/gen-regex.ts,noir/scripts/gen-regex.ts,noir/scripts/gen-inputs.ts.utils/*) for logging, file ops, subprocess, and types.tsconfig.json,jest.config.ts,jest.setup.ts,bun.lock, andpackage.json.scripts/__tests__for script workflows and utilities.packages/compiler/*).packages/circom/tests/*.Written by Cursor Bugbot for commit 3d37c31. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
New Features
Infrastructure & Build
Documentation
Tests
Chores