Commit 46bb174
authored
Final ADR-016 slice. The async boundary is now decided *purely* from
the effect side-table; the structural name list is gone.
- codegen.ml: deleted `async_primitives = ["http_request_thenable"]`.
`is_async_prim_call e = Effect_sites.is_async_call e` (no name
disjunct). `mentions_async_prim` (PR3a single-boundary guard) is now
`Effect_sites.exists_call Effect_sites.is_async_call e` — effect-
driven over the SAME shared traversal the numbering uses, so it
cannot miss a call shape the detector counts. The ADR's "table-miss
fallback" is the oracle being empty / count-mismatched (⇒ no
transform = exact pre-#234 behaviour), NOT a name list.
- effect_sites.ml: factored the call traversal into shared
`visit_expr`/`visit_block`/`visit_program`; `fold_calls` (program)
and the new `exists_call` (expr) both use it — single source, no
drift between numbering and sub-expression scans. (Dead legacy body
removed.)
- typecheck.ml: **root-cause fix for the cross-module gap S4 exposed.**
`populate_call_effects` only scanned the local unit's `prog_decls`;
imported async primitives (`http_request_thenable` — declared
`/{Net,Async}` in stdlib Http, resolved as a wasm import, NOT in
`prog_decls`) got EPure ⇒ once the structural mask was removed the
CPS transform stopped firing for them. Now falls back to the
callee's resolved scheme in `ctx.name_types` (populated by resolve,
incl. imports), unioning the arrow-spine effect components (declared
row ⊆ that; superset is sound for "row ⊇ Async").
Verification: full `tools/run_codegen_wasm_tests.sh` green —
http_cps_base/capture/chain + http_response_reader (imported
`http_request_thenable`, now via scheme-eff) AND
effect_async_boundary (user `/{Async}` fn) all pass with NO structural
list. `dune test --force` 290/290. Zero regression.
#234 fully delivered: S1 ADR-016 (#270), S2a numbering (#275), S2b
table (#276), S3 codegen switch (#277), S4 (this).
Closes #234.
1 parent 52b799c commit 46bb174
3 files changed
Lines changed: 140 additions & 90 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1917 | 1917 | | |
1918 | 1918 | | |
1919 | 1919 | | |
1920 | | - | |
1921 | | - | |
1922 | | - | |
1923 | | - | |
1924 | | - | |
1925 | | - | |
1926 | | - | |
1927 | | - | |
1928 | | - | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
1929 | 1929 | | |
1930 | 1930 | | |
1931 | | - | |
1932 | | - | |
1933 | | - | |
1934 | | - | |
1935 | 1931 | | |
1936 | | - | |
1937 | | - | |
1938 | | - | |
1939 | | - | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
1940 | 1937 | | |
1941 | | - | |
1942 | | - | |
| 1938 | + | |
1943 | 1939 | | |
1944 | 1940 | | |
1945 | 1941 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
80 | 41 | | |
81 | 42 | | |
82 | | - | |
| 43 | + | |
| 44 | + | |
83 | 45 | | |
84 | 46 | | |
85 | | - | |
| 47 | + | |
| 48 | + | |
86 | 49 | | |
87 | 50 | | |
88 | 51 | | |
89 | 52 | | |
90 | 53 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
97 | 101 | | |
98 | | - | |
99 | | - | |
| 102 | + | |
| 103 | + | |
100 | 104 | | |
101 | | - | |
102 | | - | |
| 105 | + | |
| 106 | + | |
103 | 107 | | |
104 | | - | |
105 | | - | |
| 108 | + | |
| 109 | + | |
106 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
107 | 115 | | |
108 | | - | |
109 | | - | |
| 116 | + | |
| 117 | + | |
110 | 118 | | |
111 | 119 | | |
112 | 120 | | |
113 | 121 | | |
114 | | - | |
| 122 | + | |
115 | 123 | | |
116 | 124 | | |
117 | 125 | | |
| |||
124 | 132 | | |
125 | 133 | | |
126 | 134 | | |
127 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
128 | 147 | | |
129 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
130 | 158 | | |
131 | 159 | | |
132 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1794 | 1794 | | |
1795 | 1795 | | |
1796 | 1796 | | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
1797 | 1823 | | |
1798 | 1824 | | |
1799 | 1825 | | |
| |||
1802 | 1828 | | |
1803 | 1829 | | |
1804 | 1830 | | |
1805 | | - | |
1806 | | - | |
| 1831 | + | |
| 1832 | + | |
1807 | 1833 | | |
1808 | 1834 | | |
1809 | 1835 | | |
| |||
0 commit comments