Commit 029be26
Aiur: flat append-only QueryMap + env-gated record-size stats (#444)
* Aiur: flat append-only QueryMap + env-gated record-size stats
Replace the per-circuit FxIndexMap<Vec<G>, QueryResult> with flat arenas:
keys/outputs/multiplicities in contiguous Vec<G>s (fixed stride per
circuit) indexed by a hashbrown HashTable<u32>. The record IS the proof
witness so entries cannot be dropped — only stored compactly: per-entry
RAM drops from ~133 B (two heap Vecs + IndexMap bucket + allocator
metadata) to ~54 B, and execution runs ~3x faster wall-clock (no
per-call heap allocation, better locality). Entry index == insertion
order, preserving the memory-circuit pointer semantics. Circuit stats
are bit-identical to the map-based form.
Measured on ByteArray.utf8DecodeChar?_utf8EncodeChar_append: at the
op-count where the old representation OOM-killed a 249 GB box (12.9B
ops, 1.64B entries), the flat form sits at 104 GB vs 246 GB, with
bit-identical memory-circuit entry counts.
Also adds IX_AIUR_QUERY_STATS=1: periodic (every 2^31 ops) + final
dumps of per-function entry counts and retained G-elems, the
RAM-attribution diagnostic used to find this and the kernel-side
pathologies.
* chore: Move QueryMap to its own file
* fmt + clippy
---------
Co-authored-by: samuelburnham <45365069+samuelburnham@users.noreply.github.com>1 parent 3c09339 commit 029be26
8 files changed
Lines changed: 244 additions & 36 deletions
File tree
- src
- aiur
- ffi/aiur
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 19 | | |
26 | 20 | | |
27 | 21 | | |
| |||
31 | 25 | | |
32 | 26 | | |
33 | 27 | | |
34 | | - | |
35 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
39 | | - | |
| 36 | + | |
40 | 37 | | |
41 | 38 | | |
42 | 39 | | |
| |||
158 | 155 | | |
159 | 156 | | |
160 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
161 | 193 | | |
162 | 194 | | |
163 | 195 | | |
| |||
172 | 204 | | |
173 | 205 | | |
174 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
175 | 210 | | |
176 | 211 | | |
177 | 212 | | |
| |||
213 | 248 | | |
214 | 249 | | |
215 | 250 | | |
| 251 | + | |
216 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
217 | 259 | | |
218 | 260 | | |
219 | 261 | | |
| |||
236 | 278 | | |
237 | 279 | | |
238 | 280 | | |
239 | | - | |
| 281 | + | |
240 | 282 | | |
241 | 283 | | |
242 | 284 | | |
243 | 285 | | |
244 | | - | |
| 286 | + | |
245 | 287 | | |
246 | | - | |
| 288 | + | |
247 | 289 | | |
248 | 290 | | |
249 | 291 | | |
| |||
266 | 308 | | |
267 | 309 | | |
268 | 310 | | |
269 | | - | |
| 311 | + | |
270 | 312 | | |
271 | | - | |
| 313 | + | |
272 | 314 | | |
273 | 315 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
279 | 321 | | |
280 | 322 | | |
281 | 323 | | |
| |||
289 | 331 | | |
290 | 332 | | |
291 | 333 | | |
292 | | - | |
| 334 | + | |
293 | 335 | | |
294 | 336 | | |
295 | 337 | | |
296 | | - | |
| 338 | + | |
297 | 339 | | |
298 | | - | |
| 340 | + | |
299 | 341 | | |
300 | 342 | | |
301 | 343 | | |
| |||
542 | 584 | | |
543 | 585 | | |
544 | 586 | | |
545 | | - | |
546 | 587 | | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
552 | 593 | | |
553 | 594 | | |
554 | 595 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
72 | | - | |
73 | 71 | | |
74 | 72 | | |
75 | | - | |
| 73 | + | |
| 74 | + | |
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
| |||
0 commit comments