Phase 4: islands, frozen graphs and arc through every layer (RFC 0014)
AIR: types island<T>, frozen<T>, arc<T>, iref<T>; 16 instructions (island.create/alloc/root/borrow/freeze/destroy, frozen.root/borrow/ release, arc.from_frozen/new/clone/release/root/borrow, iref.eq); features islands (depends on heap) and arc (depends on islands) published. Verifier: IslandSafe/ArcSafe (E2111 at the owner type), container child borrows (one mut access per island), Send/Share rows (island not Share), linear owners, mem.alloc effect, element rules (recursion through iref). Interpreter: graphs with never-reused identities, T0010 for a foreign iref, O(1) freeze/conversion/transfer, arc counts in a trace hook (Options.arc_events), budgets per the quota table, collector support. .aji layer 9: types, operations, island.at/frozen.at/arc.at as borrow places with explicit container borrows, iref ==/!=. Frontend fix: joins carry only variables the construct assigns (and that are read again), so an unchanged linear value is never a block argument while borrowed. Tests: 10 AIR (phase4), 6 .aji run + 12 rejects (layer9), the reference program island-pipeline in .aji, equivalent to an independently hand-written AIR program (36 on 30 schedule seeds); unit tests for the arc count trace and O(1) transfer. Quick Reference §7 graphs (checked excerpt of quickref/graphs.aji); coverage 61/61. Bundle growth: AIR +7.0%, Quick Reference +0.6k, source docs +4.2k (recorded). Spec: quota rows match the header-reserved count; idioms and iref recursion in spec 03 §22; P4-11 (air-text.ebnf gaps) recorded.
This commit is contained in:
1 parent
ca84ab4348
commit
c699529fec
58 files changed
+2189
-98
No files matched your search
@@ -13,24 +13,24 @@ while_2(%i_4: u64):
|
||||
cbr %cmp_5, @body_6(), @after_3()
|
||||
after_3:
|
||||
channel.close_sender %tx
|
||||
%c_17 = const.u8 0
|
||||
ret %c_17
|
||||
%c_16 = const.u8 0
|
||||
ret %c_16
|
||||
body_6:
|
||||
%tx_7 = borrow.mut %tx
|
||||
channel.send %tx_7, %i_4, ok -> @ok_8, closed -> @closed_9, cancelled -> @cancelled_11
|
||||
ok_8:
|
||||
borrow.end %tx_7
|
||||
br @endmatch_13(%i_4)
|
||||
br @endmatch_13()
|
||||
closed_9(%closed_10: u64):
|
||||
borrow.end %tx_7
|
||||
br @after_3()
|
||||
cancelled_11(%cancelled_12: u64):
|
||||
borrow.end %tx_7
|
||||
br @after_3()
|
||||
endmatch_13(%i_14: u64):
|
||||
%c_15 = const.u64 1
|
||||
%t_16 = add.checked.u64 %i_14, %c_15
|
||||
br @while_2(%t_16)
|
||||
endmatch_13:
|
||||
%c_14 = const.u64 1
|
||||
%t_15 = add.checked.u64 %i_4, %c_14
|
||||
br @while_2(%t_15)
|
||||
|
||||
fn @main(%heap: cap<mem.alloc>) -> u64
|
||||
effects [mem.alloc, task.spawn, task.wait]
|
||||
@@ -49,32 +49,32 @@ loop_11(%acc_13: u64, %r_14: receiver<u64>):
|
||||
%r_16 = borrow.mut %r_14
|
||||
channel.recv %r_16, ok -> @ok_17, closed -> @closed_19, cancelled -> @cancelled_20
|
||||
after_12(%acc_15: u64):
|
||||
%r_37 = task.join %t_10
|
||||
%r_35 = task.join %t_10
|
||||
task.scope.end %sc_8
|
||||
br @endmatch_38(%acc_15)
|
||||
br @endmatch_36(%acc_15)
|
||||
ok_17(%ok_18: u64):
|
||||
borrow.end %r_16
|
||||
%t_21 = add.checked.u64 %acc_13, %ok_18
|
||||
br @endmatch_34(%t_21, %r_14)
|
||||
br @endmatch_32(%t_21, %r_14)
|
||||
closed_19:
|
||||
borrow.end %r_16
|
||||
channel.close_receiver %r_14, ok -> @ok_22, pending -> @pending_23
|
||||
cancelled_20:
|
||||
borrow.end %r_16
|
||||
channel.close_receiver %r_14, ok -> @ok_28, pending -> @pending_29
|
||||
channel.close_receiver %r_14, ok -> @ok_27, pending -> @pending_28
|
||||
ok_22:
|
||||
br @after_12(%acc_13)
|
||||
pending_23(%pending_24: receiver<u64>):
|
||||
br @endmatch_25(%acc_13, %pending_24)
|
||||
endmatch_25(%acc_26: u64, %r_27: receiver<u64>):
|
||||
br @endmatch_34(%acc_26, %r_27)
|
||||
ok_28:
|
||||
br @endmatch_25(%pending_24)
|
||||
endmatch_25(%r_26: receiver<u64>):
|
||||
br @endmatch_32(%acc_13, %r_26)
|
||||
ok_27:
|
||||
br @after_12(%acc_13)
|
||||
pending_29(%pending_30: receiver<u64>):
|
||||
br @endmatch_31(%acc_13, %pending_30)
|
||||
endmatch_31(%acc_32: u64, %r_33: receiver<u64>):
|
||||
br @endmatch_34(%acc_32, %r_33)
|
||||
endmatch_34(%acc_35: u64, %r_36: receiver<u64>):
|
||||
br @loop_11(%acc_35, %r_36)
|
||||
endmatch_38(%match_39: u64):
|
||||
ret %match_39
|
||||
pending_28(%pending_29: receiver<u64>):
|
||||
br @endmatch_30(%pending_29)
|
||||
endmatch_30(%r_31: receiver<u64>):
|
||||
br @endmatch_32(%acc_13, %r_31)
|
||||
endmatch_32(%acc_33: u64, %r_34: receiver<u64>):
|
||||
br @loop_11(%acc_33, %r_34)
|
||||
endmatch_36(%match_37: u64):
|
||||
ret %match_37
|
||||
Reference in new issue
Block a user