Bun Zig Source Audit - 2026-05-26
On this page 6
Audit workspace: /tmp/home-bun-parity-main
Pinned upstream:
/Users/chrisbreuer/Code/bun@fd0b6f1a271fca0b8124b69f230b100f4d636af6
Summary
packages/runtime/UPSTREAM_SHA.txtmatches upstream Bun HEAD.packages/runtime/src/contains 1391 Zig files.scripts/measure-parity.sh --valuesreports 98 runtime source subsystems, 128 JSC files, and the unchanged 552 / 1193 integrated baseline.- Full upstream Zig source presence is now complete in this worktree:
the 72-file source presence gap has been closed, leaving zero missing
upstream Zig paths in
packages/runtime/src/. - Copied Bun corpus presence is complete for
.test.ts/.test.jsfiles: upstream Bun and Home both have 1720 paths, with zero missing and zero extra copied test files. - The copied bundler corpus has 89
bundler/**/*.test.{ts,js}files. Current green evidence covers 86 unique files, leaving the exact 3-file frontier listed indocs/BUN_PARITY_PLAN.md.
SQL / Valkey / DNS JSC Integration Audit
- Fidelity check against
/Users/chrisbreuer/Code/bun/src:packages/runtime/src/sql_jsc/**andpackages/runtime/src/runtime/dns_jsc/**Zig files are byte-identical to their Bun upstream counterparts; only Bun's sibling Rust/Cargo files are absent from Home. packages/runtime/src/runtime/valkey_jsc/**is byte-identical for copied Zig files exceptValkeyContext.zig, which already carries a local provenance comment plus a no-op unit test around the upstream emptydeinit.- Current build wiring has the standalone Valkey context reachable via
home_rt.runtime.valkey.Contextand pulled into thehome_rttest root. The remaining SQL JSC, DNS JSC, and Valkey JSC leaves immediately reach larger unported surfaces (jsc.Codegen, DNS/c-ares bridges, socket groups, crypto, and protocol/runtime back-edges), so they should be integrated as follow-up chunks after narrow compatibility aliases are identified per leaf. - Focused gate run on 2026-05-26:
/Users/chrisbreuer/Code/Home/lang/pantry/.bin/zig build test -Dfilter=home_rt -Denable_jsc=false --summary failuresexits 0 with the current worktree. During this audit it briefly stopped before the SQL/Valkey/DNS JSC chunk on an unrelated concurrentruntime/cli/test/parallel/Channel.zigZig 0.17 whitespace parse issue; that file is outside the SQL/Valkey/DNS JSC ownership slice.
Parallel Test Runner Integration Audit
- The copied
runtime/cli/test/parallel/{Channel,Coordinator,Worker,aggregate,runner}.zigfiles are now namespace-visible throughhome_rt.runtime.cli.test_.parallelalongside the previously wiredFileRange.zigandFrame.zigleaves. - Home adds only narrow compatibility around the copied source: a minimal
uwssocket/vtable shim inhome_rt.zig, Zig 0.17 syntax cleanup forChannel's scratch buffer, and the upstream-compatible enum decode replacement forstd.meta.intToEnum. - Focused evidence currently covers channel frame ingestion/remainder
handling, unknown-frame recovery, oversized-payload termination, and
aggregate JUnit attribute parsing. This is compile-frontier integration,
not full
home test --parallelbehavior; worker process spawning, coordinator scheduling, and end-to-end parallel corpus execution remain the next behavioral gates.
Native Plugin Frontier Audit
- The final bundler frontier file
bundler/native-plugin.test.tscurrently fails before execution asunsupported module syntax, but that parser result is not the meaningful blocker. The fixture is Bun's native bundler-plugin ABI test: it buildsnative_plugin.ccwith node-gyp, requires the resulting.node, passes a N-API external tobuild.onBeforeParse, and validatesBUN_PLUGIN_NAME, symbol lookup, source replacement, loader handoff, error logging, version checks, invalid free-context handling, first-plugin-wins behavior, concurrency, and crash-name reporting. - The relevant copied Zig/header substrate is present. Local byte checks
against
/Users/chrisbreuer/Code/bunpassed forpackages/runtime/src/bundler/ParseTask.zig,packages/runtime/src/jsc/NodeModuleModule.zig, andpackages/runtime/upstream/packages/bun-native-bundler-plugin-api/bundler_plugin.h.packages/runtime/src/runtime/api/JSBundler.zigalready declares theJSBundlerPlugin__callOnBeforeParsePluginsextern surface, andpackages/runtime/src/runtime/napi/napi.zigis present for the N-API side. - The missing integration is the native/JSC bridge that Bun implements in
src/jsc/bindings/JSBundlerPlugin.cpp,src/jsc/bindings/napi.cpp, andsrc/jsc/bindings/napi_external.cpp, including the private dlopen handle attached to N-API modules and the crash-handler plugin-name path. These sources are copied underpackages/runtime/upstream/, but they are not yet compiled or ported into Home's JSC-enabled runtime. - Recommended sequence: wire the copied C++ bridge or port it faithfully,
ensure
node-gypbuilt addons can load through Home's.nodepath, enablebuild.onBeforeParseto register real native callbacks, then promotebundler/native-plugin.test.tswith single-file corpus evidence. A corpus-local.nodemock should not be counted as parity.
Closed Source Presence Gap
Copied paths grouped by top-level upstream source directory:
| Directory | Copied paths |
|---|---|
sql_jsc/ | 38 |
runtime/ | 14 |
http_jsc/ | 7 |
css_jsc/ | 3 |
sys_jsc/ | 3 |
js_parser_jsc/ | 2 |
semver_jsc/ | 2 |
ast_jsc/ | 1 |
patch_jsc/ | 1 |
url_jsc/ | 1 |
Copied paths:
ast_jsc/logger_jsc.zigcss_jsc/color_js.zigcss_jsc/css_internals.zigcss_jsc/error_jsc.zighttp_jsc/headers_jsc.zighttp_jsc/websocket_client.zighttp_jsc/websocket_client/CppWebSocket.zighttp_jsc/websocket_client/WebSocketDeflate.zighttp_jsc/websocket_client/WebSocketProxy.zighttp_jsc/websocket_client/WebSocketProxyTunnel.zighttp_jsc/websocket_client/WebSocketUpgradeClient.zigjs_parser_jsc/Macro.zigjs_parser_jsc/expr_jsc.zigpatch_jsc/testing.zigruntime/cli/test/parallel/Channel.zigruntime/cli/test/parallel/Coordinator.zigruntime/cli/test/parallel/Worker.zigruntime/cli/test/parallel/aggregate.zigruntime/cli/test/parallel/runner.zigruntime/dns_jsc/cares_jsc.zigruntime/dns_jsc/dns.zigruntime/dns_jsc/options_jsc.zigruntime/valkey_jsc/ValkeyCommand.zigruntime/valkey_jsc/index.zigruntime/valkey_jsc/js_valkey.zigruntime/valkey_jsc/js_valkey_functions.zigruntime/valkey_jsc/protocol_jsc.zigruntime/valkey_jsc/valkey.zigsemver_jsc/SemverObject.zigsemver_jsc/SemverString_jsc.zigsql_jsc/mysql.zigsql_jsc/mysql/JSMySQLConnection.zigsql_jsc/mysql/JSMySQLQuery.zigsql_jsc/mysql/MySQLConnection.zigsql_jsc/mysql/MySQLContext.zigsql_jsc/mysql/MySQLQuery.zigsql_jsc/mysql/MySQLRequestQueue.zigsql_jsc/mysql/MySQLStatement.zigsql_jsc/mysql/MySQLValue.zigsql_jsc/mysql/protocol/DecodeBinaryValue.zigsql_jsc/mysql/protocol/ResultSet.zigsql_jsc/mysql/protocol/Signature.zigsql_jsc/mysql/protocol/any_mysql_error_jsc.zigsql_jsc/mysql/protocol/error_packet_jsc.zigsql_jsc/postgres.zigsql_jsc/postgres/AuthenticationState.zigsql_jsc/postgres/DataCell.zigsql_jsc/postgres/PostgresRequest.zigsql_jsc/postgres/PostgresSQLConnection.zigsql_jsc/postgres/PostgresSQLContext.zigsql_jsc/postgres/PostgresSQLQuery.zigsql_jsc/postgres/PostgresSQLStatement.zigsql_jsc/postgres/SASL.zigsql_jsc/postgres/Signature.zigsql_jsc/postgres/command_tag_jsc.zigsql_jsc/postgres/error_jsc.zigsql_jsc/postgres/protocol/error_response_jsc.zigsql_jsc/postgres/protocol/notice_response_jsc.zigsql_jsc/postgres/types/PostgresString.zigsql_jsc/postgres/types/bool.zigsql_jsc/postgres/types/bytea.zigsql_jsc/postgres/types/date.zigsql_jsc/postgres/types/json.zigsql_jsc/postgres/types/tag_jsc.zigsql_jsc/shared/CachedStructure.zigsql_jsc/shared/ObjectIterator.zigsql_jsc/shared/QueryBindingIterator.zigsql_jsc/shared/SQLDataCell.zigsys_jsc/error_jsc.zigsys_jsc/fd_jsc.zigsys_jsc/signal_code_jsc.zigurl_jsc/url_jsc.zig
Recount Commands
git -C /Users/chrisbreuer/Code/bun rev-parse HEAD
cat packages/runtime/UPSTREAM_SHA.txt
./scripts/measure-parity.sh --values
find /Users/chrisbreuer/Code/bun/test -type f \( -name '*.test.ts' -o -name '*.test.js' \) | wc -l
find packages/runtime/test/bun-corpus -type f \( -name '*.test.ts' -o -name '*.test.js' \) | wc -l