For agents, on top of README.md, which they read first.
- The flags on this target (
rustc_flags,linker_flagsinBUCK) are the whole point of the crate - do not "clean them up". Removing-Cdebug-assertions=yesmakessubsecond::calla no-op silently (it still compiles and runs, it just never patches); removing-Csave-temps=trueremoves the.rcgu.oobjectstools/hotpatchlinks into the patch. -Cdebug-assertions=yeson THIS target is not enough by itself -subsecond::call/try_callarecfg!(debug_assertions)-gated (subsecond/src/lib.rs:250-254, :411-414), andcfg!()resolves against whichever crate's OWN compilation the macro invocation lives in, not the downstream consumer's. Under cargo, one profile setting covers the whole dependency graph; under buck2/reindeer,//third-party/rust:subsecondis its OWN independent rustc invocation, built at the toolchain's default (no debug-assertions) unless told otherwise. That's whatthird-party/rust/fixups/subsecond/fixups.toml'srustc_flags = ["-Cdebug-assertions=yes"]is for. Measured 2026-09-20: without it,apply_patchreturnsOkand "patch applied" prints, butnmon the patched binary shows zero calls to subsecond's ownget_jump_tablefrom anywhere inmain- the whole redirect was silently inert.subsecond::callneeds a barefnitem, not a closure that captures anything -ticktakes no arguments and reads astatic AtomicU64instead of a closure-capturedn, andmaincallssubsecond::call(tick)directly, neversubsecond::call(|| tick(n)). Two independent reasons, both measured 2026-09-20, discovered together as apparent inlining but actually two separate causes:HotFn::try_call's redirect key depends onsize_of::<F>()(subsecond/src/lib.rs:420 on): a closure whose captured environment happens to be exactly pointer-width (oneu64, one reference, …) takes the "treat this value as a bare fn pointer" branch (call_as_ptr/transmute_copy::<Self, Self::Real>), which is only correct for an ACTUAL bare fn pointer - for a real capturing closure of that size it transmutes captured DATA as if it were a function address.- At this project's forced
-Copt-level=3(toolchains/BUCK), rustc's default cross-codegen-unit ThinLTO (visible as the*.rcgu.thin-lto-*.bcfiles next to the.rcgu.os) inlines a small, single-call-site function into its caller.subsecond's crate carries no#[inline(never)]anywhere (it's written assuming a dev-profile-style build where little gets inlined); without#[inline(never)]ontickitself,tick's own body - and the wholesubsecond::call/HotFn/HotFunction::call_itchain around it - collapsed into one block insidemainwith no addressable symbol left to redirect a call to. If either fix is missing,apply_patchstill succeeds and prints nothing wrong - the log just keeps printing the old string forever. That silence is what makes both traps worth restating here rather than only in the research doc.
tick's string literal is the thing this crate exists to let you change without restarting the process. Editing anything else inmain.rsis a bigger, unproven patch (research/subsecond-patch-build.md's workspace-replay path, §2/§5) - keep edits here to that one function while proving the pipeline.TICKSresets to 0 on every patch, on purpose - it's part of the tip crate's own recompiled objects, not carried over from an unchanged dependency crate, so subsecond's "globals are tracked" claim (subsecond/src/lib.rs's module doc) doesn't apply to it. Don't read this as a bug to fix; it's the same limitation as the thread-local one that doc already names.- Never run this outside the devshell; like every other target here it needs
the pinned fenix rustc, not whatever
rustcis on the hostPATH.