Skip to content

Ci test fix#98

Merged
cs01 merged 17 commits intomainfrom
ci-test-fix
Mar 6, 2026
Merged

Ci test fix#98
cs01 merged 17 commits intomainfrom
ci-test-fix

Conversation

@cs01
Copy link
Owner

@cs01 cs01 commented Mar 6, 2026

ci: stabilize CI pipeline, fix 4 failing stage1 linux tests

Summary

CI infrastructure

  • Run unit tests in CI — added explicit unit test step to the CI workflow; scripts/test.js now does smart rebuilds (skips if dist/ and .build/chad are fresh) and fails fast if vendor artifacts are missing
  • Explicit test:node / test:native npm scripts — removes magic auto-detection in test.js; callers pick the compiler explicitly
  • Pin all Linux jobs to ubuntu-22.04 — prevents silent runner upgrades from breaking builds
  • Cache vendor build artifactsvendor/ and c_bridges/*.o are cached by hash of build-vendor.sh, vendor-pins.sh, and bridge sources; saves 2-3 min per run on cache hits
  • Commit package-lock.json, enable npm caching — reproducible installs and faster CI
  • Pin vendor versions — extracted version pins to scripts/vendor-pins.sh; each worktree builds its own vendor/ to prevent cross-worktree corruption
  • Fix vendor pin tags — yyjson uses no v prefix; corrected tree-sitter and picohttpparser tags
  • Split network/http-routes into a separate CI step — keeps the main test job fast; integration tests that need a live HTTP server run independently
  • Upgrade Linux LLVM 18 → 21 — matches macOS runners (brew installs LLVM-21); fixes stage1 SIGSEGV on static-fields/static-methods caused by LLVM-18 miscompiling the generated IR

Bug fixes

  • strings/string-lastindexof + builtins/os-basic stage1 SIGSEGValloca instructions were emitted inside conditional branches instead of the function entry block; fixed by using nextAllocaReg() in generateLastIndexOf (search.ts) and convertNumberToString (constants.ts)
  • classes/static-fields + classes/static-methods stage1 SIGSEGV — same symptom, root cause was LLVM-18; resolved by the LLVM-21 upgrade above
  • http-route fixture — fixed req.queryString usage and Request interface field order to match the native HttpRequest struct layout

Test plan

  • All 419 unit tests pass
  • node dist/chad-node.js build src/chad-native.ts -o .build/chad succeeds
  • CI passes on both Linux (LLVM-21) and macOS (LLVM-21)

cs01 and others added 5 commits March 6, 2026 10:20
…on on linux

- add reset() to IGeneratorContext interface and MockGeneratorContext
- call ctx.reset() at start of generateConstructor, generateDefaultConstructorFromTypes, generateMethod, generateStaticMethod so each function starts temp numbering at %0
- revert --target-cpu=x86-64 from stage0 build (broke macos arm64 ci)

fixes static-fields, static-methods stage1 failures caused by non-sequential unnamed value numbering

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… methods

full reset() was clearing symbolTable.clearLocals() which wiped type info
needed during self-hosting compilation, causing 'unknown property' errors.
resetCounters() only resets temp/alloca/label counters and type maps,
preserving the symbol table state across class method generation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cs01 cs01 merged commit 0d69479 into main Mar 6, 2026
12 checks passed
@cs01 cs01 deleted the ci-test-fix branch March 6, 2026 22:56
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