Repository navigation
im-rc -> im: Arc-backed persistent carriers (step 1 of Arc share), with perf receipt - #6929
Conversation
The shorter `im::` token lets rustfmt fit several previously-wrapped calls on one line. regen_stage0 --verify reported divergence_count=1 (compiler_tests.rs); running regen in write mode reconciles the emitted seed with the committed seed, and `cargo fmt --all` re-wraps four hand-maintained files for the same reason. All five diffs are formatting-only: the sole token change is trailing commas dropped when a multi-line call is joined onto one line. regen_stage0 --verify now reports regen_divergence_count=0 across 6 runs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The C1 realization note (2026-07-14) asserted two blockers for SharedTypecheckCaches: (a) use std::collections::HashMap shells, not im_rc::HashMap, and (b) Arc not Rc for every payload. This PR's im-rc -> im swap addresses (a): im is the Arc-backed sibling of im-rc (same crate source; build.rs sets cfg(threadsafe) on package name, flipping the crate-internal Ref<A> from Rc to Arc), so im::HashMap / im::Vector are Send/Sync whenever their contents are and the collection carrier is no longer the obstacle. (b) STANDS: the payloads are still Rc-backed and therefore still !Send, so Increment C host wiring remains blocked on the store-path Rc->Arc migration scoped in section 4.2. This PR changed no Rc. Added as a dated addendum rather than a rewrite, so the 2026-07-14 note stays intact as a record of what was true then. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Main moved 4 commits (namespace wave 1 #6848, Rc-to-Arc share spike #6913, orchestration dissolution #6921, effect-grants slice A #6920), 978 files. 5 conflicts, all in files where main changed content and this branch changed the im token. Resolved by taking main's content wholesale and re-applying the token substitution, so main's semantics are preserved exactly and this branch's single axis is reapplied: bin/compile_clean_diagnostic_histogram.rs, bin/infer_semantics_witness.rs, cli_run.rs, global_bare_corpus_census_test.rs, type_env_scope_chain_test.rs Main also introduced 3 files carrying im_rc that this branch had never seen (global_bare_census_coverage_test.rs, global_bare_variant_locals_receipt_test.rs from the namespace wave, plus pipeline.rs via automerge). Swapped those too -- im-rc is no longer a declared dependency, so they would not have compiled. Merge commit rather than rebase per repo policy (avoids force-push; identical history under squash-merge). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Re: review 40261 (REQUEST_CHANGES) — valid when made, already addressed on the current head. That review ran against Verified on head The specific cited lines now read: use im::HashMap; // receipt_test.rs:6
.collect::<im::Vector<_>>(), // census_coverage_test.rs:58
.fold(im::HashMap::new(), |acc, si| { // census_coverage_test.rs:66
census_only_sources: Rc::new(im::Vector::new()), // pipeline.rs:9475
Proven by execution rather than by grep — the reviewer's claim was that the crate would not compile: One pre-existing No commit accompanies this reply because there is nothing left to fix; the fix is already in the branch. — sent from cool-wren-467 |
Step 1 of the Arc-share lane: swap the persistent-collection crate
im-rcforits Arc-backed sibling
im. NoRc→Arcchange anywhere — that is step 2,gated on the perf number below.
Why this is a prerequisite, not a follow-on
The typed payloads are built out of
im_rccollections (TypeEnv.bindingsisRc<HashMap<..>>whereHashMapisim_rc::HashMap;04_infer,infer_env,infer_items,std_coreall open with theim_rcprelude). An outerArccannotmake such a value
Sendwhile its interior isim_rc-backed, so the collectioncrate has to move first.
What actually changes — exactly one axis
imandim-rc15.1 are the same crate source.build.rsmatches onCARGO_PKG_NAMEand emitscargo:rustc-cfg=threadsafeonly forim; that cfg flipsone alias in the crate's
util.rs:Every other difference between the two crates'
src/**is doc-comment only(verified by
diff -r). Public API, macro set, and algorithms are identical. Theonly feature
im-rchas thatimlacks ispool, which we do not request.v2.std.value_carrierdeclares only the algorithmic shape(
^hash_array_mapped_trie,^relaxed_radix_balanced_tree) and never names a crate,so the declared model is untouched — this is a §2 Realization handler swap.
imrequires no source changes: the seed compiled on the first try. NeitherVector<A>norHashMap<K,V>declares aSend/Syncbound, soVector<Rc<Node>>still compiles. Nothing became
Sendin this PR — theValuesubstrate is stillstd::rc::Rc, by design.Diff shape
Pure token substitution over
.rs(161),.toml(11),.dag(10) — 432 changedlines, every one differing by nothing but the
imtoken (checkedprogrammatically).
.mdfiles are left alone: they are dated design records andhistorical receipts, and rewriting them would falsify the record.
Emitter authority (the
.dagside, which drives the generated seed):05_emit_rust.dagprelude rows +emit_cargo_dep,runtime_rust.dagrt_header,stage0_crates.dagdependency rows,compiler_tests_rust.dag, and 6dag/tools/self_host_*transports.Second commit is regen:
im::is 5 chars shorter thanim_rc::, so rustfmt re-joinspreviously-wrapped calls.
--verifyreporteddivergence_count=1(
compiler_tests.rs); write-mode regen reconciles it, andcargo fmt --allre-wraps4 hand-maintained files for the same reason. All formatting-only — the sole token
change is trailing commas dropped when a multi-line call is joined onto one line.
The
Cargo.tomlrationale comment previously asserted "im-rc is the Rc-backed(thread-confined, matching the Value Rc-discipline) crate". A mechanical substitution
would have turned that into a falsehood, so it is rewritten to state what is now true
and why the swap happened.
Oracles (green by execution, not typecheck)
Box for every number below: container
ec014146f776, 128 vCPU visible, cgroupmemory.max31.25 GiB (notMemAvailable115 GiB, which is the host view),local build (
CTRL_BUILD_MODE=local— the session default is remote, which wouldhave invalidated the receipt), sccache off, load avg ~5–13 from co-tenant sessions.
1. Self-host fixed point — converges.
regen_stage0 --verify,regen_divergence_count=0on 6/6 post-swap runs (and 6/6 pre-swap, the control).2. Emitted corpus — equivalent.
--emit-freshbefore and after, 131 files each,same file set. After applying the
imtoken substitution and normalizing whitespaceand join-dropped trailing commas: 131/131 files equivalent, 0 residual differences.
Nothing semantic moved in parse → resolve → typecheck → emit.
3. Interpreter corpus — byte-identical.
claim_batch --roster-from-discoveryoverdag+src/v2, 2,074 witness rows — the only oracle that exercises theRefrefcount in the eval hot path, so it is the one that actually tests Rc→Arc.
5494b7df2131a2dc…5494b7df2131a2dc…diffof the sorted row sets: zero differences. The 2 failures(
non_fold_residue_clean_holds,non_fold_residue_no_unrostered_or_stale) arepre-existing on the clean tree at
73eea76dd7— captured in the baseline before anyedit, and unchanged by this PR.
Perf receipt
Instrument:
regen_stage0 --verify,phases[compile_stage0]— the pure-computephase, excluding the
cargo fmtsubprocess. n=6 per arm, same box, same protocol.im-rc)im)Delta: +4.1% min-to-min (median +2.7%; mean +5.2%, or +3.3% excluding one
52,242 ms contention outlier).
Min-to-min is the estimator I'd weight: the workload is deterministic and CPU-bound,
so noise can only add time. The post arm's higher variance is co-tenant contention
during that window, not a property of the change. Every trial was
status=completed.Not editorialized further — that number is step 2's input.