sim: hostlife: an adopted host's writer_box is the box running its pre-release process
Found by the rev 7.11 100,000-seed baseline (seed 94288): the adoption left holder.writer_box at its zero value, the first cold admission's writes_lost named box 0, and the legacy process's writes on box 2, lost with its disk, went undeclared.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2 files changed,
+6
−1
internal/sim/hostlife/background_test.go+5 −1internal/sim/hostlife/ltx_test.go+1 −0
diff --git a/internal/sim/hostlife/background_test.go b/internal/sim/hostlife/background_test.go| index ae03d1aa1..a6987b728 100644 |
| --- a/internal/sim/hostlife/background_test.go |
| +++ b/internal/sim/hostlife/background_test.go |
| @@ -165,7 +165,11 @@ func (w *world) adopt() bool { |
| if eb == nil { |
| return false |
| } |
| - n := &claim{Ver: 1, Holder: &holder{Inc: w.rec.Inc, App: w.rec.App, Legacy: true, Location: locationFor(w.rec.Inc, true), Stamp: 1, Session: 1}, // adoption writes holder.stamp (claim rev 6.5 §2); the session starts with it |
| + // adoption writes holder.stamp (claim rev 6.5 §2); the session starts |
| + // with it, and the pre-release process on the executing box is its |
| + // writer (rev 7.11: the first cold admission's writes_lost names it; |
| + // seed 94288 / 100,000 named box 0 and left the legacy writes undeclared) |
| + n := &claim{Ver: 1, Holder: &holder{Inc: w.rec.Inc, App: w.rec.App, Legacy: true, Location: locationFor(w.rec.Inc, true), Stamp: 1, Session: 1, WriterBox: eb.ID}, |
| Op: opState{Kind: "serving", Exec: eb.ID, Parts: []int{eb.ID}}, Regions: []int{w.rec.Region}, Boxes: []int{eb.ID}, Complete: false} |
| if w.stampBox == nil { |
| w.stampBox = map[int]int{} |
diff --git a/internal/sim/hostlife/ltx_test.go b/internal/sim/hostlife/ltx_test.go| index e2575dcd2..0bd85c0f1 100644 |
| --- a/internal/sim/hostlife/ltx_test.go |
| +++ b/internal/sim/hostlife/ltx_test.go |
| @@ -439,6 +439,7 @@ func (w *world) closeStep(b *box) { |
| b: &blob{Kind: "closed", Gen: db.Gen, Inc: db.Inc, Stamp: db.Stamp, Seq: b.ID, Session: db.Session, TX: db.Pos}} |
| w.issue(b.ID, db.CloseReq) |
| w.stats["clean closes"]++ |
| + |
| } |
| if db.CloseReq.done { |
| db.Closing, db.CloseReq = false, nil |