Skip to content

Add pattern_typecheck bench (Rust typecheck timing on reduced path patterns)#79

Open
Felipe705x wants to merge 2 commits into
mainfrom
bench/typecheck-vs-reference
Open

Add pattern_typecheck bench (Rust typecheck timing on reduced path patterns)#79
Felipe705x wants to merge 2 commits into
mainfrom
bench/typecheck-vs-reference

Conversation

@Felipe705x

@Felipe705x Felipe705x commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Adds src/bin/pattern_typecheck.rs, a diagnostic bench that times the Rust type checker in isolation on the internal-bench cases reduced to the FPPC path-pattern surface — for auditability of the §5.4 typecheck comparison.

What it measures

Times check_query on the reduced cases (MATCH/RETURN dropped, a query-level WHERE inlined into the descriptor), isolated from the runtime, with a reused checker and 1k warmup / 10k iters. Each case carries an expected verdict (valid / empty / invalid); the bench asserts the checker reproduces it, so a timing is never trusted for a case it classifies unexpectedly.

Decoupled by design

The bench measures only Rust and writes its own per-case medians to results_rust_typecheck.csv, symmetric to the pygql bench_typecheck.py. It does not read any reference CSV: comparing against another checker is a separate local join of the two benches' outputs, so neither bench depends on the other's results.

Usage

cargo run --release --bin pattern_typecheck -- [path.gdb] [out.csv]

Defaults: dataset bench/data/ldbc-sf0.1.gdb, output results_rust_typecheck.csv.

Notes

  • Self-contained: no hardcoded machine paths, no external-file dependency.
  • Pulls only always-on library deps, so it builds under any feature set; auto-discovered as a bin (no Cargo.toml entry, no required-features).
  • cargo fmt --check and cargo clippy -D clippy::all are clean.

🤖 Generated with Claude Code

Felipe705x and others added 2 commits July 6, 2026 23:23
Times `check_query` on the internal-bench cases reduced to the FPPC
path-pattern surface (MATCH/RETURN dropped, query-level WHERE inlined),
isolated from the runtime with a reused checker and 1k warmup / 10k
iters. Optionally joins the numbers against a reference CSV to print a
per-case ratio and geomean, and sanity-checks that each verdict
(valid/empty/invalid) matches the reference.

Self-contained: default dataset path bench/data/ldbc-sf0.1.gdb, reference
CSV passed as an argument (no comparison printed when absent). Only pulls
always-on library deps, so it builds under any feature set.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The bench now measures only the Rust type checker and writes its own
per-case medians to results_rust_typecheck.csv (symmetric to the pygql
bench). It no longer reads any reference CSV — comparing against another
checker is a separate local join of the two benches' outputs, so neither
bench depends on the other's results.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Felipe705x Felipe705x changed the title Add pattern_compare bench (typecheck on reduced path patterns) Add pattern_typecheck bench (Rust typecheck timing on reduced path patterns) Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant