Commit 35ff41d
fix(cache): enable incremental IR cache for multi-file test suites
Three bugs prevented the incremental IR cache from working with
multi-file test suites:
1. IR cache filename collision: get_ir_cache_filename() truncated the
128-bit fingerprint to 64 bits (first 16 hex chars). Since
fingerprint_bytes() computes high from CRC32C of the first half of
the key data, keys differing only in test_entry_index (last 4 bytes)
produced identical filenames, causing files to overwrite each other.
Fix: use the full 32-char hex hash.
2. Race condition: parallel suite compilation workers called
save_incremental_cache() concurrently, corrupting the shared
incr.bin file. Fix: protect with mutex.
3. Cache was disabled: multi-file suites had incremental=false as a
workaround for the above bugs. Now enabled since root causes fixed.
Result: ~7.5x speedup on cached test runs (92s → 12s for core/fmt).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 6da98ef commit 35ff41d
2 files changed
Lines changed: 12 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
553 | | - | |
| 553 | + | |
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
354 | 355 | | |
355 | 356 | | |
356 | 357 | | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
427 | | - | |
| 427 | + | |
| 428 | + | |
428 | 429 | | |
| 430 | + | |
429 | 431 | | |
430 | 432 | | |
431 | 433 | | |
| |||
450 | 452 | | |
451 | 453 | | |
452 | 454 | | |
453 | | - | |
| 455 | + | |
| 456 | + | |
454 | 457 | | |
455 | 458 | | |
456 | 459 | | |
| |||
459 | 462 | | |
460 | 463 | | |
461 | 464 | | |
| 465 | + | |
| 466 | + | |
462 | 467 | | |
463 | 468 | | |
464 | 469 | | |
| |||
0 commit comments