Skip to content

auto-rebuild stale native compiler in test runner#489

Merged
cs01 merged 1 commit intomainfrom
fix-stale-native-compiler
Mar 20, 2026
Merged

auto-rebuild stale native compiler in test runner#489
cs01 merged 1 commit intomainfrom
fix-stale-native-compiler

Conversation

@cs01
Copy link
Owner

@cs01 cs01 commented Mar 20, 2026

Summary

  • Fixes mysterious test failures after source changes by detecting when .build/chad is older than dist/ and auto-rebuilding it
  • Previously the test runner only checked if .build/chad exists, not whether it's current — a stale native compiler silently produces wrong codegen, causing tests to fail with confusing errors (wrong truthiness, SIGSEGVs, missing features)

Test plan

  • npm run verify:quick passes
  • Verified: when dist/ is newer than .build/chad, test runner prints "Native compiler is stale, rebuilding" and rebuilds before running tests

@github-actions
Copy link
Contributor

Benchmark Results (Linux x86-64)

Benchmark C ChadScript Go Node Bun Place
Binary Trees 1.343s 1.222s 2.767s 1.180s 0.985s 🥉
Cold Start 1.4ms 0.8ms 1.2ms 23.8ms 8.8ms 🥇
Fibonacci 0.814s 1.534s 1.563s 3.151s 1.941s 🥈
File I/O 0.115s 0.090s 0.086s 0.211s 0.183s 🥈
JSON Parse/Stringify 0.004s 0.005s 0.018s 0.015s 0.007s 🥈
Matrix Multiply 0.449s 0.694s 0.613s 0.367s 0.347s #5
Monte Carlo Pi 0.389s 0.410s 0.404s 2.248s 6.026s 🥉
N-Body Simulation 1.678s 2.118s 2.203s 2.387s 3.267s 🥈
Quicksort 0.215s 0.245s 0.213s 0.261s 0.226s #4
SQLite 0.356s 0.400s 0.441s 0.403s 🥈
Sieve of Eratosthenes 0.015s 0.028s 0.020s 0.039s 0.036s 🥉
String Manipulation 0.008s 0.045s 0.016s 0.035s 0.027s #5

CLI Tool Benchmarks

Benchmark ChadScript grep node xxd Place
Hex Dump 0.429s 1.035s 0.128s 🥈
Recursive Grep 0.019s 0.009s 0.094s 🥈

@cs01 cs01 merged commit c4bc22f into main Mar 20, 2026
13 checks 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