Skip to content

test: add level-one throughput acceptance benchmarks - #175

Merged
SkyeAv merged 4 commits into
stronger-l1/pr-rankingfrom
stronger-l1/perf-tests
Sep 15, 2026
Merged

SkyeAv merged 4 commits into
stronger-l1/pr-rankingfrom
stronger-l1/perf-tests

Conversation

@SkyeAv

@SkyeAv SkyeAv commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Adds absolute throughput acceptance benchmarks for the normalized level-one path on both sides of the FFI, gated on the median of three warmed-up runs with bounds calibrated for slow CI hardware.

Python (tests/test_nlp.py)

  • test_level_one_performance_one_million_terms: 1M seeded multi-token terms through level_one(...).collect(), generation excluded from timing, one warmup, then three timed runs with the median gated at ≤8.0s; output shape and representative normalized values asserted so the artifact is exercised, not just timed.

Rust (rust/src/nlp.rs)

  • normalize_terms_performance_one_million_terms: 1M terms through the pyo3 batch entry with warmup and three timed runs, median gated at ≤12.0s, output length/content asserted; deterministic LCG-seeded workload (seed 5005), locale/network/optional-extra independent, runs as a normal #[test] (never ignored).

Design

  • Calibrated bounds, no relative comparisons: measured ~0.6s (Python) and ~0.8s (Rust) on a 12-core dev box vs ~3.2s and 3.6–4.9s per sample on 2-core CI runners; the ceilings keep >2× headroom on the slowest observed environment while still failing immediately for the guarded regression classes: map_elements per-row UDFs, serial fallback, and accidental quadratic token work (minutes at this N, not seconds).
  • Median-of-three absorbs scheduler noise without relaxing the ceilings.

Testing

  • uv run pytest tests/test_nlp.py::test_level_one_performance_one_million_terms -n 0 -q1 passed
  • cargo test --manifest-path rust/Cargo.toml nlp::tests::normalize_terms_performance_one_million_terms -- --nocapture --test-threads=1normalize_terms median took 0.802s for 1,000,000 terms, 1 passed
  • Full NLP suite → 17 passed; clippy -D warnings, cargo fmt --check, pyright, ruff → clean

- add a seeded 1M-term Python level_one acceptance test with warmup,
  generation excluded from timing, output-shape assertions, and a 2.5s bound
- add a non-skipped Rust 1M-term batch throughput test with the same workload
  discipline and a 2.0s bound

Verified: Python acceptance 1 passed; Rust 1M batch 0.803s; full NLP tests
16 passed; clippy, pyright, ruff, cargo fmt, and diff checks clean.
- add a shared nlp_golden.tsv consumed by Rust and Python tests to keep query
  and fullmap normalization byte-equivalent
- document Unicode cleanup, Porter2 alpha stemming, token ordering/dedupe,
  pass-through tokens, null behavior, and schema-v6 rebuild requirements
- add the breaking level-one/fullmap migration and normalized preferred-name
  ranking entry to the Unreleased changelog

Verified: Rust golden 1 passed; Python golden 1 passed and NLP suite 17
passed; ruff check/format and cargo fmt clean. make check reaches pyright but
is blocked by pre-existing missing optional QC dependencies (sklearn,
sentence-transformers, numpy) in this environment.
- measure three warmed-up 1M-term runs and gate on the median to reduce
  scheduler-noise flakiness while retaining the 2.5s Python and 2.0s Rust
  acceptance ceilings
- encode the empty golden vector explicitly so the shared fixture passes
  whitespace validation without losing empty-input coverage

Verified: Rust nlp tests and clippy clean; Python performance acceptance
passed; pyright/ruff/fmt clean; git diff --check clean.
@SkyeAv
SkyeAv added this pull request to stack #177 September 15, 2026 17:41
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 00c2d031-e3cd-402e-83cc-ca0b2bcbdafa


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@SkyeAv SkyeAv changed the title stronger l1/perf tests test: add level-one throughput acceptance benchmarks Sep 15, 2026
@SkyeAv
SkyeAv marked this pull request as ready for review September 15, 2026 17:42
@SkyeAv
SkyeAv removed this pull request from stack #177 September 15, 2026 17:50
@SkyeAv
SkyeAv added this pull request to stack #179 September 15, 2026 17:51
- raise the 1M-term acceptance ceilings to 8s (Python) and 12s (Rust):
  2-core CI runners measure ~3.2s and 3.6-4.9s per sample where the dev box
  measures ~0.6s and ~0.8s, so the old 2.5s/2.0s bounds failed on slower
  hardware despite correct behavior
- document the calibration and the guarded regression classes (per-row UDFs,
  serial fallback, quadratic token work) in the test rationale

Verified: pytest tests/test_nlp.py -n 0 -> 17 passed; Rust 1M median 0.802s;
clippy, cargo fmt, ruff, pyright clean.
@SkyeAv
SkyeAv merged commit df7fc38 into main Sep 15, 2026
5 checks passed
SkyeAv added a commit that referenced this pull request Sep 15, 2026
Cut 19.0.0 and bump the package version in pyproject.toml, CITATION.cff,
and uv.lock.

Major: five breaking changes ship. The `tablassert` console command now
requires the optional `[cli]` extra, since `cyclopts` and `rich` left the
base install (#187). Level-one normalization redefines fullmap keys as
cleaned Unicode-lowercase, Porter2-normalized, byte-ordered token sets and
moves the database to schema v6, so every schema-v5 fullmap is rejected and
must be rebuilt (#171, #172, #174, #175, #176). `build-fullmap --aria2c`
is gone -- aria2c is used automatically whenever the `[aria2]` extra is
installed (#178) -- and `--taxon-allowlist` is gone because the built-in
top-100 experimental-taxon allowlist now applies to every build, guarding
both reuse paths by `META.taxon_allowlist` identity (#153). Logging now
requires the `[log]` extra and is fully disabled without it (#152).

Features: `tablassert.net` is a new stdlib-only transient/permanent
classification and retry seam shared by the agent and the BABEL downloader
(#163, #164), with one bounded jittered retry layer across the inner agent,
reflexion, and judge (#167) and machine-readable `error_code` values on
skipped checkpoint records (#166). `build-kg` gained an automatic ephemeral
shared-prefix TCode cache keyed by content-addressed XXH64 op digests
(#155-#159, #161). The `--distill` corpus became schema-uniform v2 with a
sibling `outcomes.ndjson`, a deterministic `RewardConfig`-tunable reward,
and the new zero-dependency `tablassert distill-weigh` command (#180-#183).
`CLASS_FIELD_OVERRIDES` grants the DAKP sparse qualifier stack on the pinned
association classes (#188).

Fixes: `distill-export` partitions its corpus by content and unions the
schema across record files, so a mixed v1/v2 directory no longer CastErrors
or silently stringifies a column (#184); BABEL retry warnings survive the
loguru sink; PMC downloads are idempotent, atomic, and bounded-parallel
(#165); reflexion and judge prompts are hard-bounded (#168).

Changelog:
- versioned the Unreleased section as 19.0.0 - 2026-09-15
- merged three duplicate `### Added` blocks into one
- moved the two `BREAKING:` entries from `### Changed` into
  `### Breaking Changes` and added a `**Migration:**` note to all five
- added PR links to all 17 entries, which carried none
- added the missing entries: the distill v2 corpus/reward/distill-weigh
  stack (#180-#183), the distill-export schema-drift fix (#184), the
  TCode run-cache detail (#155-#161), and the README badge removal (#154)

Docs: none needed here. Every shipped doc change landed with its own PR,
and the docs source-of-truth gate passes against the bumped tree.

Testing:
- make check -> exit 0
- uv run ruff check . -> All checks passed!
- uv run pyright -> 0 errors, 0 warnings, 0 informations
- uv run pytest -> 1622 passed, 52 skipped
- cargo test --manifest-path rust/Cargo.toml -> 156 passed, 0 failed
- cargo clippy --all-targets -- -D warnings -> clean
- uv lock --check -> resolved 169 packages, lock current
- uv run mkdocs build --strict -> exit 0
- docs SSOT + CLI coverage after the changelog edit -> 204 passed
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