quad/.claude/audit/handtrace-round10-reference-impl/spikes/d2_slots.luau
qwreey d2d67c7aeb
qa: 10라운드 광범위 탐사 완료 — 발견 H-150~H-157 (🔴 0 / 🟡 5 / 🟢 3), §4 배치 문항 7건 회신 대기
- 신선한 탐사자(fable) 단일 컨텍스트, 지시서 -round10-brief.md §2 레인 A·C 완료, B 부분, D ALL PASS
- audit/handtrace-round10-reference-impl/: round7 참조 구현을 현재 계약으로 갱신·재실행
  (부수: round7/ref9 _recompute 첫 인자 오류 발견·정정)
- base/·인덱스 레이어는 미변경 — 결정은 사용자 배치 회신 뒤 -round10-followup.md로

Co-authored-by: qwreey <me@qwreey.moe>
Claude-Session: https://claude.ai/code/session_01546hjsYNLSMZdHdPyTZaGb
2026-08-28 01:03:05 +09:00

23 lines
1.1 KiB
Text

--!nocheck
local q = require("./core"); local D = require("./dispatch")
-- Frame { Slot1, E(plain), Slot2 }
local inst = {}
local s1, s2 = D.newSlot("s1"), D.newSlot("s2")
local bl = D.getBlocker(inst); bl:On()
D.setOffsetSource(inst, 1, s1.Offset); D.setLength(inst, 1, s1.Length, inst)
D.setOffsetSource(inst, 2, D.None); D.setLength(inst, 2, 1, inst)
D.setOffsetSource(inst, 3, s2.Offset); D.setLength(inst, 3, s2.Length, inst)
bl:OffWithoutEmit(); D.recompute(inst, D.getBookkeeping(inst))
print("초기: s1.Offset =", s1.Offset:Get(), "| s2.Offset =", s2.Offset:Get(), "| recompute:", D.stats())
print("-- 런타임에 Slot1이 3개가 됨 (s1.Length:Set(3)) --")
s1.Length:Set(3)
print("s1.Offset =", s1.Offset:Get(), "| s2.Offset =", s2.Offset:Get(), "(기대 4) | recompute:", D.stats())
print("-- Slot2도 2개가 됨 --")
s2.Length:Set(2)
print("s2.Offset =", s2.Offset:Get(), "(기대 4) | 4번 자리 offset =", D.getOffsetAt(inst,4), "(기대 6)")
print("-- Slot1이 다시 0개 --")
s1.Length:Set(0)
print("s2.Offset =", s2.Offset:Get(), "(기대 1) | 4번 자리 =", D.getOffsetAt(inst,4), "(기대 3)")