Repository navigation
Commit 44881a0
committed
fix(configlink): order candidates canonically before the collector cap
collect_config_entries and collect_code_entries fill fixed-capacity arrays
and stop at max_out. They walk gbuf label indexes in insertion order, which
under parallel extraction is worker-merge order and varies run to run, so on
any repository with more candidates than the cap the surviving set — and
therefore the emitted CONFIGURES edges — depended on thread scheduling.
Sort candidates by a pure content key (qualified_name, file_path, start_line,
name) before the cap applies, so the surviving set is a function of the inputs
alone. Tie-breaks are content-only: node ids are handed out in merge order and
belong in no canonical comparator.
Also log configlinker.truncated when a collector fills to capacity, so the cap
reports itself instead of dropping candidates silently.
Measured on a 4191-file TypeScript corpus (12940 candidates against the 8192
code cap): before, 3-61 CONFIGURES edges differed per run against a
single-threaded reference and no two multi-threaded runs agreed; after, the
single-threaded reference and four multi-threaded runs are byte-identical.
Corpora below the cap were already stable, and all divergence was CONFIGURES.
Signed-off-by: Andrew Studnicky <a.j.studnicky@gmail.com>1 parent 9b9b6ff commit 44881a0
2 files changed
Lines changed: 190 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 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 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
63 | 124 | | |
64 | 125 | | |
65 | 126 | | |
| |||
70 | 131 | | |
71 | 132 | | |
72 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
73 | 138 | | |
74 | 139 | | |
75 | 140 | | |
| |||
102 | 167 | | |
103 | 168 | | |
104 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
105 | 174 | | |
106 | 175 | | |
107 | 176 | | |
| |||
124 | 193 | | |
125 | 194 | | |
126 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
127 | 202 | | |
128 | | - | |
| 203 | + | |
129 | 204 | | |
130 | 205 | | |
131 | 206 | | |
132 | 207 | | |
133 | | - | |
| 208 | + | |
134 | 209 | | |
135 | 210 | | |
136 | 211 | | |
137 | 212 | | |
138 | | - | |
| 213 | + | |
139 | 214 | | |
140 | 215 | | |
141 | 216 | | |
142 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
143 | 222 | | |
144 | 223 | | |
145 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
293 | 397 | | |
294 | 398 | | |
295 | 399 | | |
| |||
305 | 409 | | |
306 | 410 | | |
307 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
308 | 415 | | |
0 commit comments