Skip to content

refactor(codegen): migrate 4 llvm-generator resolveExpressionType sites to typeOf()#583

Merged
cs01 merged 1 commit intomainfrom
refactor/typeof-llvm-generator
Apr 20, 2026
Merged

refactor(codegen): migrate 4 llvm-generator resolveExpressionType sites to typeOf()#583
cs01 merged 1 commit intomainfrom
refactor/typeof-llvm-generator

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Apr 20, 2026

Summary

User-facing effect

  • No behavior change. Type answers are now consistent across codegen: one source of truth (typeOf) instead of direct resolver calls that might disagree with the cache.
  • Continues the Phase-E "typed AST" convergence — eliminates the "two codegen sites ask at different moments and get different answers" class of silent-wrong bugs.

Test plan

  • npm run verify — full tests + 3-stage self-host (stage 2 native oracle) green locally
  • CI green

…es to typeof() — annotator cache first, falls through to resolver (phase-e step 5)
@github-actions
Copy link
Copy Markdown
Contributor

Benchmark Results (Linux x86-64)

Benchmark C ChadScript Go Node Place
Cold Start 0.8ms 0.8ms 1.2ms 25.6ms 🥇
Fibonacci 0.817s 0.762s 1.525s 3.171s 🥇
Hash Map Lookup 0.090s 0.062s 0.089s 0.110s 🥇
Binary Trees 1.350s 1.257s 2.713s 1.158s 🥈
File I/O 0.117s 0.090s 0.085s 0.199s 🥈
JSON Parse/Stringify 0.035s 0.049s 0.171s 0.132s 🥈
N-Body Simulation 1.664s 2.122s 2.203s 2.398s 🥈
Regex Match 0.017s 0.005s 0.021s 0.004s 🥈
SQLite 0.051s 0.366s 0.480s 0.411s 🥈
String Manipulation 0.008s 0.017s 0.017s 0.037s 🥈
Monte Carlo Pi 0.389s 0.410s 0.405s 2.249s 🥉
Quicksort 0.214s 0.246s 0.213s 0.261s 🥉
Sieve of Eratosthenes 0.014s 0.028s 0.018s 0.038s 🥉
Matrix Multiply 0.439s 0.670s 0.608s 0.372s #4

CLI Tool Benchmarks

Benchmark ChadScript grep node xxd Place
Hex Dump 0.553s 0.946s 0.130s 🥈
Recursive Grep 0.019s 0.009s 0.100s 🥈

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