Skip to content

fix: repair benchmark infrastructure (9 bugs blocking any run) - #88

Closed
txloc1909 wants to merge 6 commits into
mainfrom
fix/benchmarks-infrafix
Closed

fix: repair benchmark infrastructure (9 bugs blocking any run)#88
txloc1909 wants to merge 6 commits into
mainfrom
fix/benchmarks-infrafix

Conversation

@txloc1909

Copy link
Copy Markdown
Owner

Summary

Fixes 9 bugs in the benchmark setup from PR #86 that prevented any language other than Lox++ from running. All fixes were validated by a full benchmark run — see notes/benchmark_report_2026-06-08.md for the results.

Root cause breakdown

# Issue Fix
1 AWFY commit 5e9fa8e… → GitHub 404 (archives only served for branch/tag refs) Updated to master HEAD 74306fec
2 Wren commit 4a8e084… → GitHub 404 Updated to 99d2f0b8
3 clox commit d9a658f… → GitHub 404 Changed to archive/master.tar.gz
4 manifest.toml invalid TOML — key-value on the same line as [section] header Reformatted as inline tables lox = {file = "..."}
5 JS/Lua Dockerfiles use --wildcards — not supported by Alpine's busybox tar Replaced with --strip-components=1 + explicit subdir copy
6 AWFY filenames changed from PascalCase to lowercase in current master Updated manifest; documented in SOURCES.md
7 AWFY Python/JS/Lua require harness invocation, not direct file execution Added run_awfy_python.py, run_awfy_js.js, run_awfy_lua.sh
8 clox Dockerfile missing libc6-dev on Ubuntu 24.04; wrong COPY path Added libc6-dev; fixed COPY to benchmarks/clox/
9 Lox++ outputs scientific notation (3.99e+06 us) — AWFY regex missed it, timing showed N/A Extended to [\d.eE+\-]+; added fallback to compute average from per-iteration data

Bonus: --no-container was applied to all languages instead of lox-only, causing Python/JS/Lua to run on the host (and fail with FileNotFoundError) instead of their containers. Fixed.

Wren note: The standalone wren CLI was removed from the wren upstream repo. The Wren suite benchmarks currently run Lox++ only. Dockerfile.wren is kept for future use but documents the situation.

Benchmark results (from the fixed run)

AWFY suite, average per iteration, 5 runs:

Benchmark Lox++ Python 3.12 Lua 5.4 Node.js 22
bounce 1,055 µs 1,148 µs 849 µs 983 µs
fib(35) 867,000 µs
list 1,535 µs 658 µs 641 µs 448 µs
permute 2,304 µs 1,586 µs 1,191 µs 553 µs
queens 1,458 µs 896 µs 804 µs 522 µs
sieve 1,064 µs 624 µs 424 µs 263 µs
storage 6,744 µs 1,686 µs 2,327 µs 799 µs
towers 5,922 µs 1,533 µs 1,728 µs 789 µs
json 4,176 µs 6,435 µs 8,694 µs 2,930 µs
richards 28,186 µs 26,506 µs 28,482 µs 3,857 µs

Lox++ ≈ CPython on object-heavy code; beats Python/Lua on json; 4–8× behind Node.js V8 (JIT).

Full report in notes/benchmark_report_2026-06-08.md.

🤖 Generated with Claude Code

txloc1909 and others added 6 commits June 8, 2026 23:15
…ren)

Implements all 16 AWFY benchmarks, 6 CLBG benchmarks, and 4 Wren suite
benchmarks in Lox++, plus 4 clox-compatible variants. Includes Dockerfiles
for Python/Lua/JS/Wren/clox (each bundling third-party sources at pinned
commits), manifest.toml, langs.toml, and runner.py with 4 output adapters
(awfy/wren/clbg/raw) and podman execution support.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Update AWFY commit hash from non-existent SHA to master HEAD (74306fec)
- Update Wren commit hash to an accessible commit (99d2f0b8)
- clox: switch to master.tar.gz (commit-only SHAs 404 on GitHub archives);
  add libc6-dev (missing on Ubuntu 24.04); fix COPY path to benchmarks/clox/
- JS/Lua: Alpine uses busybox tar which lacks --wildcards; replace with
  strip-components=1 extraction then explicit subdir copy
- Python: likewise switch to strip-components=1; files live in Python/ subdir
- Add run_awfy_python.py, run_awfy_js.js, run_awfy_lua.sh harness wrappers:
  AWFY benchmarks must be invoked via their Run harness, not executed directly,
  and require PascalCase class names (NBody, DeltaBlue, CD) not filenames
- Wren: document that standalone wren CLI was removed upstream; update Makefile
  path to projects/make/ and switch to strip-components extraction

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The original manifest used `[bench.lang]    file = "..."` syntax — placing a
key-value pair on the same line as a section header — which is invalid per the
TOML spec (and rejected by Python 3.14's stricter tomllib).

Reformatted every entry as an inline table:
  lox = {file = "bounce.lox"}

Also updated AWFY filenames: the current AWFY master renamed all benchmarks
from PascalCase (Bounce.py, Fib.py) to lowercase (bounce.py, fib.py).
Removed fib and earley from Python/JS/Lua entries — those files don't exist
in AWFY (lox-specific benchmarks).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- python: use run_bench.py wrapper (direct file exec produces no output)
- js: use run_bench.js wrapper (same reason)
- lua: use run_bench.sh wrapper (module search path must be set via cd)
- clox: change adapter from 'raw' (wall clock incl. container startup) to
  'clox' (self-reported elapsed time from stdout last line)
- wren: comment out — standalone CLI no longer exists in upstream repo

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1. Scientific notation in AWFY output:
   Lox++ str() prints large µs counts in scientific notation (e.g. 3.99e+06 us).
   The old regex [\\d.]+ didn't match 'e+06', so timings above ~1 s showed N/A.
   Extended to _NUM = r'[\\d.eE+\\-]+' throughout _parse_awfy. Also added a
   fallback: if the summary line isn't found, compute average from iter_us.

2. --no-container applied to all languages:
   The condition `if no_container or lang == "lox"` ran Python/JS/Lua directly
   on the host when --no-container was set, causing FileNotFoundError because
   the wrapper scripts live inside containers. Fixed to `if lang == "lox" and
   no_container` — only lox bypasses containers.

3. clox adapter added:
   clox benchmarks self-report elapsed time as the last stdout line (seconds).
   The old 'raw' adapter used wall-clock time which included ~200 ms container
   startup overhead. New _parse_clox() reads the last non-empty stdout line as
   seconds and converts to µs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- AWFY: update commit from non-existent SHA to the actual master HEAD
- AWFY: note that filenames are now lowercase; fib/earley have no Python/JS/Lua variants
- Wren: update commit; document that standalone CLI was removed upstream
- clox: document why master branch ref is used instead of a commit SHA
- Updating a pinned commit: add pre-flight check for GitHub archive reachability;
  fix build context (must be repo root, not benchmarks/) and smoke-test command

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@txloc1909
txloc1909 force-pushed the fix/benchmarks-infrafix branch from 3708557 to 8f36735 Compare June 8, 2026 16:17
@txloc1909
txloc1909 changed the base branch from feat/benchmarks to main June 8, 2026 16:17
@txloc1909

Copy link
Copy Markdown
Owner Author

Superseded — all 9 infrastructure fixes plus the deltablue and havlak benchmark fixes have been folded directly into feat/benchmarks (PR #86). Closing this PR.

@txloc1909 txloc1909 closed this Jun 8, 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