Commit 71187a2
Fix non-determinism bug: ensure 100% consistent results across runs
Root cause: as_completed() returned futures in non-deterministic order,
causing files to be processed in varying order across runs. This affected
ModuleContainmentLinker which depends on node insertion order.
Fixes:
- analyzer.py: use indexed result slots to preserve file ordering
regardless of thread completion order
- builder.py: sort set iteration in TopicLinker for deterministic edges
- store.py: return sorted neighbors instead of non-deterministic set
Verified: terraform-provider-azurerm (42,850 files) now produces
312,232 nodes and 448,540 edges consistently across 3 runs (was
varying by 3-4 nodes previously).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 08c6a17 commit 71187a2
3 files changed
Lines changed: 12 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
331 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
332 | 334 | | |
333 | 335 | | |
334 | 336 | | |
335 | 337 | | |
336 | | - | |
337 | | - | |
| 338 | + | |
| 339 | + | |
338 | 340 | | |
339 | 341 | | |
| 342 | + | |
340 | 343 | | |
341 | | - | |
| 344 | + | |
342 | 345 | | |
343 | | - | |
344 | 346 | | |
345 | 347 | | |
346 | | - | |
| 348 | + | |
347 | 349 | | |
348 | 350 | | |
| 351 | + | |
349 | 352 | | |
350 | 353 | | |
351 | 354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
| 62 | + | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
0 commit comments