Remove dead code from libuv_sys, cares_sys, simdutf FFI, test_runner, and C++ bindings - #37332
Remove dead code from libuv_sys, cares_sys, simdutf FFI, test_runner, and C++ bindings#37332robobun wants to merge 5 commits into
Conversation
… and C++ bindings
Rust:
- bun_libuv_sys (Windows-only): 169 extern declarations no Rust code
referenced (tcp/udp/tty/poll/prepare/check/fs_poll/threading/os-info
surface), the structs and callback aliases only they used, the UvReq
marker trait, Loop/Pipe/async helper methods nobody called, and the
StdioFlags / UV_FS_O_* / priority / clock alias tables. bun_spawn now
uses UV_INHERIT_FD directly like the rest of that file.
- bun_cares_sys: ares_init/ares_send/ares_search/ares_gethostbyname/
ares_getsock/ares_timeout/ares_create_query/ares_expand_*/
ares_parse_uri_reply/ares_free_string/ares_library_init/ares_version
declarations, ares_socket_functions, struct_ares_uri_reply, and the
Windows timeval/iovec definitions that existed only for them.
- bun_brotli_sys: BrotliDecoder::{is_finished,get_error_code,version}
and the BrotliDecoderIsFinished/BrotliDecoderVersion declarations.
- bun_simdutf_sys: 22 unused extern declarations plus the 30 C++
wrappers in bun-simdutf.cpp that no longer had a caller or a
declaration (and their stubs in the parser bench shim).
- test_runner: JSValueTestExt forwarders that bun_jsc inherent methods
of the same name shadow, so no call could resolve to them; never-read
global_this fields on two formatter structs; FetchOptions.global_this;
S3ErrorJsc::to_js.
C++:
- Events_function{GetEventListeners,ListenerCount,Once,On} host
functions and the jsEventEmitterCast/JSEventEmitterWrapper helpers
only they used; jsFunctionDebugNoop and jsFunctionSyncBuiltinExports in
NodeModuleModule.cpp; jsCookieStaticFunctionSerialize and the
Cookie::serialize(span) overload behind it; nine getter declarations in
JSBakeResponse.cpp with no definition.
- UTF8Encoding(), createMockResultStructure, ActiveDOMObject::
queueTaskToDispatchEvent (+ queueTaskToDispatchEventInternal,
isAllowedToRunScript, PendingActivity::object), StreamQueue::
setTotalSize, WorkerMessagingProxy getters, unused DOMIsoSubspaces /
DOMClientIsoSubspaces slots, the commonStringInitializer typedef and
the BUN_FOREACH_CJS_NATIVE_MODULE macro.
- The five cross-realm transform stubs (declared in WebStreamsInternals.h,
each only threw "not implemented") and CrossRealmMessageType.
- EventInterfaces.h / EventTargetInterfaces.h trimmed to the interfaces
bun actually reports; surviving enumerators keep their values.
Verified with rg across src/, scripts/, test/ and regenerated codegen
output, cargo check --workspace on all 10 CI targets, cargo check
--workspace --tests, and a full bun bd build. The new source lint pins
the removed symbols.
WalkthroughThe pull request removes unused FFI declarations, WebCore and JSC binding APIs, runtime fields, SIMDUTF wrappers, and Web Streams transfer stubs. It updates Windows process spawning and adds source-lint checks for removed symbols. ChangesExternal-library FFI reduction
Windows libuv surface and spawn wiring
WebCore and JSC binding cleanup
Web Streams API reduction
Runtime and SIMDUTF cleanup
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
|
Status (head 3f65303): ready for a maintainer.
|
There was a problem hiding this comment.
I reviewed this PR and didn't find any bugs. Given the breadth (43 files, ~1700 lines across libuv_sys/cares_sys/simdutf/test_runner/C++ bindings) and the one deletion the description flags as a judgment call (the CrossRealmTransform "frozen placeholder" stubs in WebStreamsInternals.h), a human look would still be worthwhile before this lands.
What was reviewed:
- Spot-checked that removed
JSValueTestExtforwarders (to_fmt,jest_deep_equals, …) are shadowed bybun_jsc::JSValueinherents;toHaveReturnedWith.rsstill resolves. - Confirmed
SuccessfulReturnsFormatter's'glifetime is still bound viaFormatter<'g>after the field removal, andFetchOptions::global_thisis distinct from theFetchTasklet::global_thisthat is actually read. - Verified none of the removed
m_subspaceFor*/m_clientSubspaceFor*slots orjsEventEmitterCast(non-Fast) are referenced anywhere insrc/. - Checked the new source-lint's simdutf Rust↔C++ symbol-set assertion covers the
mod base64declarations and that its\bjsEventEmitterCast\bregex won't false-positive onjsEventEmitterCastFast.
Extended reasoning...
Overview
This is a scheduled dead-code sweep removing ~1700 lines across 43 files: unused extern "C" declarations and structs in the Windows-only bun_libuv_sys crate (~619 lines), bun_cares_sys, bun_brotli_sys, both sides of the simdutf FFI, unused JSValueTestExt trait forwarders in the test runner, never-read struct fields (CustomMatcherParamsFormatter::global_this, SuccessfulReturnsFormatter::global_this, FetchOptions::global_this), and a large set of C++ bindings (uninstalled Events_function* host functions, jsCookieStaticFunctionSerialize, ActiveDOMObject::queueTaskToDispatchEvent, unused iso-subspace slots, the CrossRealmTransform stubs, and trimming the WebCore EventInterfaces/EventTargetInterfaces enums to the entries Bun actually reports). A new source-lint test pins 67 of the removed symbols and asserts the simdutf Rust and C++ declaration sets stay in sync.
Security risks
None. This is pure deletion of unreferenced declarations, wrappers, and struct fields; no data flow, validation, or auth path changes. The only added code is a source-tree lint that reads files with readFileSync and matches regexes.
Level of scrutiny
Moderate-to-high. Each individual deletion is mechanical and the PR description documents an unusually thorough verification (rg across src/scripts/test/packages + regenerated codegen output, cargo check on all 10 CI triples including the Windows-only libuv crate, full bun bd, targeted test runs). I spot-checked several load-bearing claims and they held: to_fmt is a JSValue inherent so the trait forwarder was truly shadowed; the 'g lifetime on SuccessfulReturnsFormatter is still bound after the field removal; the removed FetchOptions::global_this is a different field from the heavily-used FetchTasklet::global_this; none of the removed iso-subspace slots or jsEventEmitterCast appear anywhere in src/; c_ushort is still used in c_ares.rs after c_long was dropped from the import.
However, the sheer breadth (Windows-only FFI that only Windows CI exercises, WebCore-ported enums, streams internals) and the fact that one deletion is explicitly flagged by the author as a judgment call rather than a provable leftover put this outside the "simple/mechanical" bar for auto-approval.
Other factors
- The author explicitly calls out the CrossRealmTransform stub deletion as "the one group in the PR that is a judgment call rather than a leftover, so it is easy to drop if you would rather keep the placeholders" — that's a maintainer decision, not something an automated review should sign off on.
- The description notes a known merge interaction with #32268 (which adds
RETURN_IF_EXCEPTIONinside theEvents_function*bodies deleted here). - CI is described as "waiting"; the Windows lanes are the only place the ~619-line
bun_libuv_sysdeletion is compile-checked. - No prior human review on the timeline; CodeRabbit was rate-limited.
|
Thanks for the pass. On the two points worth tracking for a human reviewer:
|
|
Updated 7:20 PM PT - Aug 10th, 2026
✅ @robobun, your commit 3f65303a0ed52e176edc5107d6273d0d7bf44c14 passed in 🧪 To try this PR locally: bunx bun-pr 37332That installs a local version of the PR into your bun-37332 --bun |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/simdutf_sys/simdutf.rs (1)
36-40: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winProtect the complete deleted SIMDUTF surface.
The source-lint deny-list in
test/internal/source-lints/dead-symbols-ffi-sys-test-runner-cpp.test.tsdoes not include every symbol removed here. For example, it omitssimdutf__convert_valid_utf8_to_utf16beandsimdutf__convert_utf8_to_utf32.If Rust and C++ reintroduce both declarations, the parity assertion passes and the lint does not detect the regression. Add every removed symbol to the deny-list, or generate the list from one manifest.
The shown source-lint expression and the removed declarations provide the supporting evidence.
Also applies to: 61-61, 71-71, 91-91, 101-101, 111-111, 121-121, 129-130
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/simdutf_sys/simdutf.rs` around lines 36 - 40, Expand the deny-list in dead-symbols-ffi-sys-test-runner-cpp.test.ts to include every removed SIMDUTF FFI symbol, including simdutf__convert_valid_utf8_to_utf16be and simdutf__convert_utf8_to_utf32, so reintroduced Rust and C++ declarations are detected. Prefer deriving the list from a shared manifest if the existing test structure supports it, and preserve the parity assertion.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/internal/source-lints/dead-symbols-ffi-sys-test-runner-cpp.test.ts`:
- Line 78: Update the dead-symbols test entry to match the actual `struct
ares_uri_reply` declaration, replacing the underscore-form pattern with a
pattern that accounts for the whitespace between `struct` and `ares_uri_reply`.
- Line 139: Update the dead-symbol test entry for
jsCookieStaticFunctionSerialize to reference src/jsc/bindings/Cookie.cpp instead
of JSCookie.cpp, ensuring the check reads the file containing the removed
declaration.
---
Outside diff comments:
In `@src/simdutf_sys/simdutf.rs`:
- Around line 36-40: Expand the deny-list in
dead-symbols-ffi-sys-test-runner-cpp.test.ts to include every removed SIMDUTF
FFI symbol, including simdutf__convert_valid_utf8_to_utf16be and
simdutf__convert_utf8_to_utf32, so reintroduced Rust and C++ declarations are
detected. Prefer deriving the list from a shared manifest if the existing test
structure supports it, and preserve the parity assertion.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 319eecd7-6ff3-4bf2-8257-cac7796f545f
📒 Files selected for processing (43)
src/brotli_sys/brotli_c.rssrc/cares_sys/c_ares.rssrc/cares_sys/lib.rssrc/jsc/bindings/BunHttp2CommonStrings.hsrc/jsc/bindings/Cookie.cppsrc/jsc/bindings/Cookie.hsrc/jsc/bindings/DOMFormData.hsrc/jsc/bindings/JSBakeResponse.cppsrc/jsc/bindings/JSMockFunction.cppsrc/jsc/bindings/TextEncoding.cppsrc/jsc/bindings/TextEncoding.hsrc/jsc/bindings/webcore/ActiveDOMObject.cppsrc/jsc/bindings/webcore/ActiveDOMObject.hsrc/jsc/bindings/webcore/DOMClientIsoSubspaces.hsrc/jsc/bindings/webcore/DOMIsoSubspaces.hsrc/jsc/bindings/webcore/EventInterfaces.hsrc/jsc/bindings/webcore/EventTargetInterfaces.hsrc/jsc/bindings/webcore/JSCookie.cppsrc/jsc/bindings/webcore/JSEventEmitter.cppsrc/jsc/bindings/webcore/JSEventEmitter.hsrc/jsc/bindings/webcore/JSEventEmitterCustom.cppsrc/jsc/bindings/webcore/JSEventEmitterCustom.hsrc/jsc/bindings/webcore/Performance.hsrc/jsc/bindings/webcore/WorkerMessagingProxy.hsrc/jsc/bindings/webcore/streams/CrossRealmTransform.cppsrc/jsc/bindings/webcore/streams/JSWritableStreamDefaultController.cppsrc/jsc/bindings/webcore/streams/StreamQueue.hsrc/jsc/bindings/webcore/streams/StreamsForward.hsrc/jsc/bindings/webcore/streams/WebStreamsInternals.hsrc/jsc/modules/NativeModuleList.hsrc/jsc/modules/NodeModuleModule.cppsrc/libuv_sys/libuv.rssrc/parsers/benches/support/simdutf_shim.cppsrc/runtime/test_runner/expect.rssrc/runtime/test_runner/expect/toHaveReturnedWith.rssrc/runtime/test_runner/mod.rssrc/runtime/webcore/fetch.rssrc/runtime/webcore/fetch/FetchTasklet.rssrc/runtime/webcore/s3/error_jsc.rssrc/simdutf_sys/bun-simdutf.cppsrc/simdutf_sys/simdutf.rssrc/spawn/process.rstest/internal/source-lints/dead-symbols-ffi-sys-test-runner-cpp.test.ts
💤 Files with no reviewable changes (33)
- src/jsc/bindings/TextEncoding.h
- src/jsc/bindings/webcore/streams/StreamQueue.h
- src/jsc/bindings/Cookie.cpp
- src/jsc/bindings/DOMFormData.h
- src/jsc/modules/NativeModuleList.h
- src/jsc/bindings/JSBakeResponse.cpp
- src/jsc/bindings/webcore/JSEventEmitterCustom.cpp
- src/jsc/bindings/webcore/streams/StreamsForward.h
- src/jsc/bindings/JSMockFunction.cpp
- src/runtime/test_runner/expect/toHaveReturnedWith.rs
- src/jsc/bindings/TextEncoding.cpp
- src/jsc/bindings/webcore/WorkerMessagingProxy.h
- src/jsc/bindings/webcore/JSEventEmitterCustom.h
- src/runtime/webcore/fetch.rs
- src/jsc/bindings/webcore/JSCookie.cpp
- src/parsers/benches/support/simdutf_shim.cpp
- src/jsc/bindings/Cookie.h
- src/runtime/webcore/s3/error_jsc.rs
- src/jsc/bindings/webcore/Performance.h
- src/jsc/bindings/webcore/ActiveDOMObject.cpp
- src/jsc/bindings/webcore/streams/WebStreamsInternals.h
- src/jsc/bindings/BunHttp2CommonStrings.h
- src/jsc/bindings/webcore/ActiveDOMObject.h
- src/jsc/bindings/webcore/JSEventEmitter.cpp
- src/jsc/bindings/webcore/EventTargetInterfaces.h
- src/jsc/bindings/webcore/EventInterfaces.h
- src/jsc/modules/NodeModuleModule.cpp
- src/simdutf_sys/bun-simdutf.cpp
- src/jsc/bindings/webcore/DOMIsoSubspaces.h
- src/brotli_sys/brotli_c.rs
- src/runtime/test_runner/mod.rs
- src/jsc/bindings/webcore/DOMClientIsoSubspaces.h
- src/jsc/bindings/webcore/JSEventEmitter.h
The parity assertion alone would pass if a removed wrapper came back on both sides of the FFI at once, so list all 30 removed names instead of a sample.
|
Review sweep after the CodeRabbit pass:
No open threads; waiting on CI for the new head. |
- simdutf bench shim: drop the three latin1 wrappers that never had a Rust declaration, and make the lint assert the shim only defines symbols simdutf.rs declares. - libuv.rs: remove the now-empty "errors" and "udp" section headers and fold the three declarations left under "ip" into the misc group. - ActiveDOMObject.cpp: drop the Event.h/EventTarget.h includes that only the removed queueTaskToDispatchEventInternal used.
|
Pushed 8db13c3 for the three review nits: the bench shim's three latin1 wrappers with no Rust declaration are removed (and the lint now checks the shim only defines symbols |
… uv_lib_t and uv_dir_t The size assertion for WIN32_FIND_DATAW only guarded its embedding in uv_dir_t; the canonical one lives next to the type in bun_windows_sys.
|
Pushed 3f65303 for the last review nit: |
There was a problem hiding this comment.
I reviewed this PR again after 3f65303 and the bug-hunting pass found no issues; all four earlier nits (simdutf shim orphans, libuv section headers, ActiveDOMObject includes, HMODULE/WIN32_FIND_DATAW re-exports) are addressed and every thread is resolved. Given the breadth of the sweep across FFI crates and C++ bindings, the author-flagged judgment call on removing the CrossRealmTransform placeholder stubs, and the noted rebase interaction with #32268, a human sign-off is still worthwhile.
What was reviewed
- Spot-checked removed FFI symbols (
uv_*,ares_*,simdutf__*) againstsrc/and codegen for callers; the simdutf Rust↔C++ parity assertion in the new lint holds. - Confirmed
EventInterfaces.h/EventTargetInterfaces.hsurvivors keep their numeric values and both factories havedefault:arms. - Verified
jsCookieStaticFunctionSerialize/Events_function*were never installed on any HashTableValue andjsFunctionSyncBuiltinExportsis distinct from the livejsFunctionSyncBuiltinESMExports. - Checked the
StdioFlags→UV_INHERIT_FDrewrite insrc/spawn/process.rsis value-preserving and covers all three call sites.
Extended reasoning...
Overview
Scheduled dead-code sweep removing ~1750 lines across 43 files: unused libuv/c-ares/brotli/simdutf FFI declarations (Rust extern blocks plus their C++ wrapper counterparts), shadowed JSValueTestExt forwarder methods and never-read struct fields in bun_runtime, and a batch of C++ bindings that were declared/defined but never installed (JSEventEmitter Events_function*, jsCookieStaticFunctionSerialize, jsFunctionDebugNoop/SyncBuiltinExports, createMockResultStructure, UTF8Encoding, ActiveDOMObject event-dispatch helpers, unused iso-subspace slots, the CrossRealmTransform throw-only stubs, and trimming the WebCore EventInterfaces/EventTargetInterfaces enums to the entries bun actually reports). One functional edit outside pure deletion: three StdioFlags::INHERIT_FD uses in src/spawn/process.rs become UV_INHERIT_FD (same value). A new source-lint test pins ~67 removed symbols and asserts simdutf Rust/C++/shim parity.
Security risks
None identified. Everything removed was uncallable (no Rust caller, not installed on any prototype/constructor, or throw-only stubs with no reachable path). No auth, crypto, permission, or input-validation surfaces are touched. The only value-bearing change (StdioFlags::INHERIT_FD → UV_INHERIT_FD) is a rename between two constants both defined as 4.
Level of scrutiny
High, and it has received it: the PR went through two CodeRabbit findings (both withdrawn as incorrect), three earlier inline nits from this reviewer plus one follow-up (all fixed in 8db13c3 / 3f65303), and the author documented per-symbol rg verification across src/, scripts/, test/, packages/, and regenerated build/debug/codegen/, with cargo check --workspace on all 10 CI triples and a full bun bd. That said, this is a wide sweep across C++ JSC bindings and Windows-only FFI, and the author explicitly flagged the CrossRealmTransform stub removal as a judgment call ("easy to drop if you would rather keep the placeholders") — that is a maintainer decision, not something an automated review should make.
Other factors
The PR notes a rebase interaction with #32268 (whichever lands second drops the Events_function* hunks). The EventInterfaces enum trimming preserves numeric values for survivors and both factories have default: arms, so I did not find a hazard there, but it and the streams-placeholder removal are the two spots where a maintainer's confirmation is most useful. Deferring rather than approving on those grounds; no code changes are requested.
Scheduled dead-code sweep. Areas this run:
src/libuv_sys,src/cares_sys,src/brotli_sys,src/simdutf_sys(both sides of the FFI),src/runtime/test_runner, a fewbun_runtimeleftovers, and C++ bindings outside the files the other open dead-code PRs touch. Net: 43 files, +218 (the new lint) / -1723.Removed
bun_libuv_sys(Windows-only crate, -619)extern "C"declarations that no Rust code references: the tcp/udp/tty/poll/prepare/check/fs_poll/threading/dl/os-info/metrics surface ofuv.h(uv_tcp_*,uv_udp_*,uv_tty_get_winsize,uv_prepare_*,uv_check_*,uv_fs_poll_*,uv_thread_*,uv_key_*,uv_once,uv_os_get_passwd,uv_os_environ,uv_queue_work,uv_getnameinfo,uv_random,uv_async_init,uv_dlopen, ...). The C symbols themselves stay exported for napi addons viasymbols.def/symbols.dyn/linker*.ldsand the force-link list innapi_body.rs; only bun's own unused Rust declarations go.uv_getnameinfo_t,uv_random_t,uv_timespec64_t,uv_timeval64_t,uv_dir_t,uv_dirent_t,uv_env_item_t,uv_passwd_t,uv_group_t,uv_metrics_t,uv_key_t,uv_once_t,uv_thread_options_t,uv_lib_t,uv_getnameinfo_cb,uv_random_cb,uv_fs_poll_cb,uv_thread_cb, plus theuv_sem_t/uv_errno_t/uv_handle_s/uv_loop_s/uv_run_mode/uv_pipe_t/uv_fs_s/struct_uv_req_s/struct_uv_stream_s/uv_dirent_type_t/FILE/uv_thread_t/uv_loop_option/uv_membership/uv_tty_vtermstate_t/uv_clock_idaliases.UvReqmarker trait and its 10 impls,Loop::dump_active_handles,Pipe::set_pending_instances_count,Pipe::as_stream_ptr,uv_async_t::init,uv_stat_t::birthtime.StdioFlags(the threeStdioFlags::INHERIT_FDuses inbun_spawnnow spellUV_INHERIT_FDlike the rest of that function),UV_FS_O_*(duplicates of theOmodule),UV_PRIORITY_*,UV_CLOCK_*,UV_LOOP_BLOCK_SIGNAL/UV_METRICS_IDLE_TIME, the udp/tty-mode/membership/copyfile flag groups,UV_MAXHOSTNAMESIZE,UV_IF_NAMESIZE,MAX_PIPENAME_LEN.bun_cares_sys(-118):ares_library_init,ares_version,ares_init,ares_set_socket_functions,ares_send,ares_search,ares_gethostbyname,ares_getsock,ares_timeout,ares_create_query,ares_expand_name,ares_expand_string,ares_parse_uri_reply,ares_free_string, theares_socket_functionsandstruct_ares_uri_replystructs, theares_ssize_t/struct_timevalaliases, two commented-outares_fds/ares_processdeclarations, and the Windowstimeval/iovecdefinitions inlib.rsthat existed only for them.bun_brotli_sys:BrotliDecoder::{is_finished, get_error_code, version}and theBrotliDecoderIsFinished/BrotliDecoderVersiondeclarations (callers useBrotliDecoderGetErrorCodedirectly).simdutf FFI (-230): 22 unused declarations in
simdutf.rsand 30 wrappers inbun-simdutf.cpp(the 22 plus 8 that had already lost their Rust declaration), and their stubs in the parser bench shim. The lint asserts the two files now declare exactly the same set ofsimdutf__*names.bun_runtimetest_runner::expect::JSValueTestExt: 17 forwarder methods (to_fmt,jest_deep_equals,values,keys,to_u32, ...) thatbun_jsc::JSValueinherent methods of the same name shadow, so no call site ever resolved to them; rustc reports them unused once the trait is scoped to the crate. The four methods that do add behavior stay.CustomMatcherParamsFormatter::global_this(and its now-unused lifetime),SuccessfulReturnsFormatter::global_this,FetchOptions::global_this.S3ErrorJsc::to_js(every caller uses thes3_error_to_jsfree fn).C++ bindings (roughly -590)
Events_functionGetEventListeners/ListenerCount/Once/OninJSEventEmitter.cpp(declared in the header, never installed anywhere) andjsEventEmitterCast+JSEventEmitterWrapper, whose only callers they were.jsEventEmitterCastFastis untouched.jsFunctionDebugNoop,jsFunctionSyncBuiltinExports(NodeModuleModule.cpp; the live export isjsFunctionSyncBuiltinESMExports).jsCookieStaticFunctionSerialize(never attached to the constructor; onlyparse/fromare) plus its helperstoCookieWrappedandCookie::serialize(VM&, span<Ref<Cookie>>). The prototypeserialize()is untouched.JSC_DECLARE_CUSTOM_GETTER(jsBakeResponsePrototypeGet*)declarations with no definition.UTF8Encoding(),createMockResultStructure(theLazyPropertyinitializer inlines the same code),ActiveDOMObject::queueTaskToDispatchEventand thequeueTaskToDispatchEventInternal/isAllowedToRunScript/PendingActivity::objecthelpers that became unreferenced with it,StreamQueue::setTotalSize,WorkerMessagingProxy::{askedToTerminate, loaderContextIdentifier, workerThread}getters, 19m_subspaceFor*/m_clientSubspaceFor*slots no class allocates from, thecommonStringInitializertypedef, theBUN_FOREACH_CJS_NATIVE_MODULEmacro, aDocumentLoadTimingforward declaration.CrossRealmTransform.cpp/WebStreamsInternals.h, which only threw "not implemented" and had no callers, plusCrossRealmMessageType.WebStreamsInternals.hdescribed these signatures as frozen placeholders from the streams port; nothing reaches them, so they are deleted here, but this is the one group in the PR that is a judgment call rather than a leftover, so it is easy to drop if you would rather keep the placeholders.EventInterfaces.h/EventTargetInterfaces.h: checked-in copies of WebCore's generated enums listing every event and event-target interface in WebKit. Trimmed to the 5 + 9 entries bun'sEvent/EventTargetsubclasses report; survivors keep their numeric values (Event::m_eventInterfaceis a 7-bit field, andEventFactory.cpp/EventTargetFactory.cppboth havedefault:arms).Verification
rgacrosssrc/,scripts/,test/,packages/and the regeneratedbuild/debug/codegen/output (plus substring searches for token-pasted names andvendor/WebKit/Sourcefor anythingextern "C").pubitems topub(crate)and intersecting rustc'sdead_codeoutput across all 8 target families, so platform-specific items (e.g.EmptyCopyFileStateon darwin,Listener::NamedPipeon Windows) were excluded automatically;bun_libuv_syswas evaluated on the Windows targets since the module iscfg(windows).cargo check --workspaceon all 10 CI triples,cargo check --workspace --tests,cargo fmt --check, clippy on the touched crates, fullbun bd, andbun bd testover events, cookies, node:module, TextEncoder/TextDecoder, expect.extend, toHaveReturnedWith, streams, fetch, zlib/brotli, mock, andtest/internal/source-lints/(the dns file's 30 network-dependent tests fail in the sandbox with ENOTFOUND both before and after; its 92 offline tests pass).test/internal/source-lints/dead-symbols-ffi-sys-test-runner-cpp.test.tspins 67 of the removed symbols (every entry was checked to match onmainand not on this branch).Notes for whoever merges
RETURN_IF_EXCEPTIONlines inside theEvents_function*bodies deleted here (its actual fix is injsEventEmitterCastFast, which this PR does not touch); whichever lands second needs a trivial rebase that drops those hunks.VM::has_termination_request,JSPromise::settle_task,job.rson_js_thread/off_thread(all added two days ago in Worker / worker_threads: WebCore-shaped lifetimes, joined threads, one ordered VM teardown #37075, presumably for follow-ups);JSC__VM__hasTerminationRequestgoes with them. Single unconstructed variants / unread payloads inside otherwise-live ABI or ported enums (SSRKind::Regular,DeclarationContext::Keyframes,StmtListWhich::AllStmts,OptionsData::Saved(usize),AsyncState::Done(ExitCode)) and the remaining partially-used libuv constant tables were also left as-is. rustc's "field is never read" hits onmulti_array_columns!schema structs (JSMeta,BuilderEntry,LineOffsetTable,ServerComponentBoundary, the isolated-installEntry,BundledAst::tla_check) and on the type-punnedSerializedSourceMapLoadedare live data, not dead code.[review] gate passed · iteration 0 · 43 files touched
fails on main (without fix)
passes on PR (with fix)
diff hotspot
gate history · 4 passed · 0 rejected · iteration 0
evidence per changed file