Commit 9adcabb
committed
FINALIZED gate: prevent segment activation before boundaries known
Replace the old profile-valid + queue-depth gates with a single
FINALIZED gate that checks optimization_state >= TC_PLAN_FINALIZED
before allowing RT to activate any segment.
- Forward pass only stamps FINALIZED when exit boundary conditions
are known: EXACT segments (vf=0 always correct), segments with a
successor in queue, or tail segments when queue is sealed.
- SKIP path re-stamps FINALIZED after backward pass knocks state
back to SMOOTHED.
- queue_sealed flag in TP_STRUCT: set by tpFlushCompressor_9D at
sync points (dwell, mode change, program end), cleared by
tpAddLine_9D/tpAddCircle_9D when new motion arrives. Lets the
optimizer finalize the tail segment immediately instead of
waiting for a successor that will never come.
- 200ms safety-net timeout for cases not covered by the seal
(first segment after tool change, program start).
- Cleanup: removed debug probes (GATE_DBG, ACTIVATE_DBG, QUEUE_DBG,
OPT_DBG, SEAL_DBG, XING_DBG, FWD_VF_DBG), stale active-segment
rewrite, pessimistic first-profile hack.1 parent 787b80c commit 9adcabb
4 files changed
Lines changed: 92 additions & 70 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
2352 | 2352 | | |
2353 | 2353 | | |
2354 | 2354 | | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
2355 | 2367 | | |
2356 | 2368 | | |
2357 | 2369 | | |
| |||
2377 | 2389 | | |
2378 | 2390 | | |
2379 | 2391 | | |
2380 | | - | |
2381 | | - | |
2382 | | - | |
2383 | | - | |
2384 | | - | |
2385 | | - | |
2386 | | - | |
2387 | | - | |
2388 | | - | |
2389 | | - | |
2390 | | - | |
2391 | | - | |
2392 | | - | |
2393 | 2392 | | |
2394 | 2393 | | |
2395 | 2394 | | |
| |||
2515 | 2514 | | |
2516 | 2515 | | |
2517 | 2516 | | |
2518 | | - | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
2519 | 2529 | | |
2520 | 2530 | | |
2521 | 2531 | | |
| |||
4053 | 4063 | | |
4054 | 4064 | | |
4055 | 4065 | | |
4056 | | - | |
4057 | | - | |
| 4066 | + | |
| 4067 | + | |
| 4068 | + | |
| 4069 | + | |
| 4070 | + | |
4058 | 4071 | | |
4059 | 4072 | | |
4060 | 4073 | | |
| |||
4101 | 4114 | | |
4102 | 4115 | | |
4103 | 4116 | | |
| 4117 | + | |
4104 | 4118 | | |
4105 | 4119 | | |
4106 | 4120 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
236 | 239 | | |
237 | 240 | | |
238 | 241 | | |
239 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
240 | 252 | | |
241 | 253 | | |
242 | 254 | | |
| |||
1337 | 1349 | | |
1338 | 1350 | | |
1339 | 1351 | | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
1340 | 1355 | | |
1341 | 1356 | | |
1342 | 1357 | | |
| |||
1585 | 1600 | | |
1586 | 1601 | | |
1587 | 1602 | | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
1588 | 1606 | | |
1589 | 1607 | | |
1590 | 1608 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
| 566 | + | |
566 | 567 | | |
567 | 568 | | |
568 | 569 | | |
| |||
4868 | 4869 | | |
4869 | 4870 | | |
4870 | 4871 | | |
4871 | | - | |
4872 | 4872 | | |
4873 | 4873 | | |
4874 | 4874 | | |
| |||
5252 | 5252 | | |
5253 | 5253 | | |
5254 | 5254 | | |
5255 | | - | |
5256 | | - | |
5257 | | - | |
5258 | | - | |
5259 | | - | |
5260 | | - | |
5261 | | - | |
5262 | | - | |
5263 | | - | |
5264 | | - | |
5265 | | - | |
5266 | | - | |
5267 | | - | |
5268 | | - | |
5269 | | - | |
5270 | | - | |
5271 | | - | |
5272 | | - | |
5273 | | - | |
5274 | | - | |
5275 | | - | |
5276 | | - | |
5277 | | - | |
5278 | | - | |
5279 | | - | |
5280 | | - | |
5281 | | - | |
5282 | | - | |
5283 | | - | |
5284 | | - | |
| 5255 | + | |
| 5256 | + | |
| 5257 | + | |
| 5258 | + | |
| 5259 | + | |
5285 | 5260 | | |
5286 | | - | |
5287 | | - | |
5288 | | - | |
5289 | | - | |
5290 | | - | |
5291 | | - | |
5292 | | - | |
5293 | | - | |
5294 | | - | |
5295 | | - | |
5296 | | - | |
5297 | | - | |
5298 | | - | |
5299 | | - | |
5300 | | - | |
5301 | | - | |
5302 | | - | |
5303 | | - | |
5304 | | - | |
5305 | | - | |
| 5261 | + | |
| 5262 | + | |
| 5263 | + | |
| 5264 | + | |
| 5265 | + | |
| 5266 | + | |
| 5267 | + | |
| 5268 | + | |
| 5269 | + | |
| 5270 | + | |
| 5271 | + | |
| 5272 | + | |
| 5273 | + | |
| 5274 | + | |
| 5275 | + | |
| 5276 | + | |
| 5277 | + | |
| 5278 | + | |
| 5279 | + | |
| 5280 | + | |
| 5281 | + | |
| 5282 | + | |
| 5283 | + | |
| 5284 | + | |
| 5285 | + | |
| 5286 | + | |
| 5287 | + | |
| 5288 | + | |
5306 | 5289 | | |
5307 | | - | |
5308 | 5290 | | |
5309 | 5291 | | |
5310 | 5292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
154 | 162 | | |
155 | 163 | | |
156 | 164 | | |
| |||
0 commit comments