Repository navigation
W-017 spike: operational take-and-detach move lowering + selective detach (#200) - #370
Open
sonson0910 wants to merge 10 commits into
Open
sonson0910 wants to merge 10 commits into
sonson0910 wants to merge 10 commits into
Conversation
2 tasks done
sonson0910
force-pushed
the
spike/w017-operational-take-and-detach
branch
from
October 17, 2026 06:32
98f4d76 to
199bc2b
Compare
sonson0910
force-pushed
the
spike/w017-operational-take-and-detach
branch
from
October 17, 2026 17:03
199bc2b to
0c3430d
Compare
Owner
|
Thank you, @sonson0910 — attached to W-017, slot 17 in the 2026-11-01 review window (discussion #365); the MOONSHOT.md ledger row now names this PR. One-line assessment: this is the strongest incoming spike of the window — pre-registered predictions and falsifiers, a 30-shape executable matrix, and negative controls that deterministically fire the race detector when each mechanism is omitted, which is exactly the verification standard the track wants. Honoring the triage scope note (HandleTable preserved, bridge deletion dropped) while still making |
sonson0910
force-pushed
the
spike/w017-operational-take-and-detach
branch
from
October 17, 2026 18:20
0c3430d to
b6be898
Compare
sonson0910
force-pushed
the
spike/w017-operational-take-and-detach
branch
from
October 18, 2026 02:05
b6be898 to
8722369
Compare
sonson0910
force-pushed
the
spike/w017-operational-take-and-detach
branch
from
October 18, 2026 09:00
8722369 to
65b9935
Compare
Open
1 task done
This was referenced Nov 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
spikes/spike12-operational-take-and-detach/) forMOONSHOT.mdledger entryW-017(Slot 17, Family A, [wildcard] Stop erasing move to a no-op: Operational Take-and-Detach Lowering in hy-emit + Deleting the CGo/Rust Staticlib Bridge #200).MOONSHOT.mdtriage scope note: drops the CGo/Rust staticlib bridge deletion and preserves the shippedu64generation-checkedHandleTable(runtime/rust+runtime/go/hyrtonarm64andx86_64), unifyingmove hon Rustown handles (__hy_take(&h)zeroes the Gouint64handle variable to0,InvalidHandleinhyrt) with operational Go-sidemove(__hy_take+ selective__hy_detach_<Shape>+ 3-index slice capacity clippings[:len(s):len(s)]).take_detach_model.rs: dependency-free Rust model (184physical lines /154code lines above#[cfg(test)], within the<250 LOCgate) with 12 tests: 3 core mechanism tests, a 30-shape executable matrix (executable_30_case_corpus_and_p0_matrix), and 8 red-team regression tests (R1–R8) covering sentinelHeapId(0)non-collision, mixed-struct double-move prevention, recursive slice capacity clipping inside structs, andown handlelinearity (HYB-E3005).work/take_detach_test.go&work/edge_test.go: Go 1.26-raceverification harness and microbenchmarks (M0..M4), including 6 positive race-free tests across the#38/#105/#120,#75/#137/#206, and#98/#138P0 report chains plus 5 negative race-detector controls (HY_NEG=TestNeg_...) that deterministically fireWARNING: DATA RACEwhen each mechanism is omitted.RESULTS.md: pre-registered predictions & falsifiers, raw 5-run benchmark tables, 30-shape matrix, and honest architectural boundaries.Evidence
12 passed, 0 failed):rustc --edition=2021 --test spikes/spike12-operational-take-and-detach/take_detach_model.rs -o /tmp/spike12_model && /tmp/spike12_model-raceharness (6 passed,5 skippednegative controls unlessHY_NEG=<TestName>is set):go1.26.4 linux/amd64, 5 runs):M0_NoopMove:0.3586 ns/op,0 B/op,0 allocs/opM1_HyTake_FastPath_Inline:0.2993 ns/op,0 B/op,0 allocs/opM1b_HyTake_FastPath_NoInline:1.136 ns/op,0 B/op,0 allocs/opM2_HyTake_ClippedSlice:0.7505 ns/op,0 B/op,0 allocs/opM3_HyDetach_SharedMap8:73.55 ns/op,256 B/op,2 allocs/opM4_HyTake_RustOwnHandle:0.2736 ns/op,0 B/op,0 allocs/opgit diff --checkpasses cleanly.Scope and honest limitations
This PR is a research/feasibility spike only (
spikes/spike12-operational-take-and-detach/); it does not modifycompiler/crates/*. As documented inRESULTS.md:may_shareis simplified, not eliminated: fast-path selection (__hy_takewithout__hy_detach) requires knowing no live peer binding, closure capture, or evaluateddeferargument still shares backing storage (TestNeg_FastPathMissedAlias,TestNeg_DeferArgEvaluatedBeforeMove,r8). WhatW-017eliminates is the need to prove which alias path is dead after joins/rebinds — conservativemay_sharesafely emits__hy_detach_<Shape>.HYB-E3003remains required: in Go, reads (m["k"],len,range) andappendon zeroed (nil) maps/slices succeed silently without panicking (TestNilAndEmptyMoves).__hy_take(&x)writes the source slot: zeroingxin place introduces a write tox(TestNeg_TakeWritesCapturedSlot), so prior closure variable captures by reference must be treated as live loans (HYB-E3101).maps.Cloneis shallow (TestNeg_ShallowDetachMapOfSlices), so__hy_detach_<Shape>must recurse per mutable reference level and fail closed (HYB-E3005) on cyclic pointer graphs.Links