writeonce/compiler/test/golden/bc/residual.expected
shoney.arickathil 79605cbb4f feat: milestone 1 complete — .wob emitter, conformance corpus, single binary; GC redesign specced
- `woc` now emits `.wob` that `wovm` runs: emit.ml lowers the typed,
  owner-annotated AST (scope-stack registers with a >64 WO-E401 diagnostic,
  Lua-style call windows, ICALL by slot, dedup const pool, drop maps, line
  tables, implicit terminators); disasm.ml backs `--dump-bc` goldens.
- Ownership lowering consumes the four owner tables verbatim; RESIDUAL is the
  only source of borrow ops, coalesced per operand. Review caught the emitter
  consuming only 2 of owner.ml's 4 residual producers — an assignment-anchored
  aliasing violation ran to exit 0 instead of trapping; fixed, plus a backstop
  raising WO-E404 for any residual region left unconsumed.
- Conformance harness `scripts/oop-e2e.sh` (`just oop-e2e`): four fixture
  kinds with exact outcomes — byte-exact stdout, one WO-E### anchored on
  `error CODE:`, numeric trap code, gc trace. 25 fixtures incl. pricing-demo
  logic, the ownership suite, and DB_STUB's parse-but-trap. `tests/` un-ignored
  so the corpus is actually tracked.
- `woc build` produces a self-contained binary: wovm copy + appended image +
  20-byte trailer, self-exec via /proc/self/exe. Verified relocated outside
  the repo, argless, and against adversarial trailer corruption.
- Milestone 1's five spec criteria all MET (`just oop-accept`). Criterion 3
  closed by WO-E405 — the entry must return `Int`, since program mode already
  says its return value is the exit code — which deletes the leak class
  without adding return-type metadata to the format. `gc/held-cycle` retired:
  an externally-held cycle is not expressible in a post-exit pump.
- New spec: inferred GC + incremental per-shard tri-color mark-sweep, retiring
  `@gc` and reference counting. Story gains iterations 7b (that work) and 9b
  (`@table`, relations, compiler-checked query); `.dev/reference` gains a
  sparse System.Linq checkout. Priority: 5→6→7 (log-watcher) then 7b, 8, 9, 9b.
2026-08-11 19:31:26 +02:00

156 lines
3.9 KiB
Text

== CONSTANTS ==
k0 TEXT "Item"
k1 TEXT "Bag"
k2 TEXT "touch"
k3 TEXT "pair"
k4 TEXT "fixed"
k5 TEXT "touch3"
k6 TEXT "triple"
k7 TEXT "write_through"
k8 TEXT "main"
k9 INT 0
k10 INT 1
k11 INT 5
k12 INT 2
k13 INT 3
== CLASSES ==
c0 Item flags=- fields=[SCALAR]
c1 Bag flags=- fields=[MULTI]
== INTERFACES ==
== VTABLES ==
== METHODS ==
m0 touch args=2 regs=4 [free fn]
lines: 0->19
drops: (none)
0000 GETF r2, r0, f0
0001 GETF r3, r1, f0
0002 ADD r2, r2, r3
0003 RET r2
m1 pair args=3 regs=9 [free fn]
lines: 0->23
drops: (none)
0000 GETF r7, r0, f0
0001 MOVE r8, r1
0002 BUILTIN r5, r7, multi_get
0003 GETF r7, r0, f0
0004 MOVE r8, r2
0005 BUILTIN r6, r7, multi_get
0006 MOVE r3, r5
0007 MOVE r4, r6
0008 BORROW_X r3
0009 BORROW_X r4
0010 CALL r5, m0
0011 RELEASE_X r4
0012 RELEASE_X r3
0013 MOVE r3, r5
0014 RET r3
m2 fixed args=1 regs=5 [free fn]
lines: 0->27
drops: (none)
0000 GETF r3, r0, f0
0001 LOADK r4, k9
0002 BUILTIN r1, r3, multi_get
0003 GETF r3, r0, f0
0004 LOADK r4, k10
0005 BUILTIN r2, r3, multi_get
0006 CALL r1, m0
0007 RET r1
m3 touch3 args=3 regs=7 [free fn]
lines: 0->37
drops: (none)
0000 GETF r4, r0, f0
0001 GETF r5, r1, f0
0002 ADD r3, r4, r5
0003 GETF r6, r2, f0
0004 ADD r3, r3, r6
0005 RET r3
m4 triple args=4 regs=12 [free fn]
lines: 0->41
drops: (none)
0000 GETF r10, r0, f0
0001 MOVE r11, r1
0002 BUILTIN r7, r10, multi_get
0003 GETF r10, r0, f0
0004 MOVE r11, r2
0005 BUILTIN r8, r10, multi_get
0006 GETF r10, r0, f0
0007 MOVE r11, r3
0008 BUILTIN r9, r10, multi_get
0009 MOVE r4, r7
0010 MOVE r5, r8
0011 MOVE r6, r9
0012 BORROW_X r4
0013 BORROW_X r5
0014 BORROW_X r6
0015 CALL r7, m3
0016 RELEASE_X r6
0017 RELEASE_X r5
0018 RELEASE_X r4
0019 MOVE r4, r7
0020 RET r4
m5 write_through args=3 regs=7 [free fn]
lines: 0->49 3->50 6->51 12->52
drops: (none)
0000 GETF r4, r0, f0
0001 MOVE r5, r1
0002 BUILTIN r3, r4, multi_get
0003 GETF r5, r0, f0
0004 MOVE r6, r2
0005 BUILTIN r4, r5, multi_get
0006 LOADK r5, k11
0007 BORROW_X r4
0008 BORROW_S r3
0009 SETF r4, f0, r5
0010 RELEASE_S r3
0011 RELEASE_X r4
0012 GETF r5, r3, f0
0013 RET r5
m6 main args=0 regs=6 [free fn] [ENTRY]
lines: 0->56 3->57 8->58 13->59 18->60 24->61 28->62 35->63 41->55
drops: pc 3 owned={r0} gc={}
drops: pc 42 owned={} gc={}
0000 NEW r0, c1
0001 BUILTIN r1, kinds=0x01, multi_new
0002 SETF r0, f0, r1
0003 GETF r1, r0, f0
0004 NEW r2, c0
0005 LOADK r3, k10
0006 SETF r2, f0, r3
0007 BUILTIN r1, r1, multi_push
0008 GETF r1, r0, f0
0009 NEW r2, c0
0010 LOADK r3, k12
0011 SETF r2, f0, r3
0012 BUILTIN r1, r1, multi_push
0013 GETF r1, r0, f0
0014 NEW r2, c0
0015 LOADK r3, k13
0016 SETF r2, f0, r3
0017 BUILTIN r1, r1, multi_push
0018 MOVE r2, r0
0019 LOADK r3, k9
0020 LOADK r4, k10
0021 CALL r2, m1
0022 MOVE r1, r2
0023 BUILTIN r1, r1, print_int
0024 MOVE r2, r0
0025 CALL r2, m2
0026 MOVE r1, r2
0027 BUILTIN r1, r1, print_int
0028 MOVE r2, r0
0029 LOADK r3, k9
0030 LOADK r4, k10
0031 LOADK r5, k12
0032 CALL r2, m4
0033 MOVE r1, r2
0034 BUILTIN r1, r1, print_int
0035 MOVE r2, r0
0036 LOADK r3, k9
0037 LOADK r4, k10
0038 CALL r2, m5
0039 MOVE r1, r2
0040 BUILTIN r1, r1, print_int
0041 DROP r0
0042 RET0
== ENTRY ==
m6