Prevent XYZAC TP queue starvation

This commit is contained in:
2026-09-02 10:41:21 +08:00
parent 0a22c7bf1b
commit 32adda73d6
10 changed files with 77 additions and 16 deletions

View File

@@ -129,13 +129,20 @@ source_length: 200509
line_count: 4711
preview_segments: 4684
fixed_tick_samples: 3000
execution_line: 147
execution_trace_entries: 145
execution_line: 337
execution_trace_entries: 335
motion_authority: wasm
motion_delta_snapshots: 0
ledger_audit_window: 32
running_queue_gaps: 0 (excluding the initial startup tick)
```
## 长距离连续性判定
`3D_Chips.ngc` 第 17 行设置 `G64 P.1`,后续是大量连续短段。对标 LinuxCNC source TP 时,正常表现是 TP 在当前段运行期间持续保留前瞻队列;G64 不应在普通同模式段之间出现人为的零速度空队列 tick。此前 Worker 在等待当前段完全结束后才入队下一段,造成截图中可见的短暂停顿,这不是源 LinuxCNC 的合理结果。
已修复为:同一运动学模式的下一段可在当前 TC 活动时进入 source TP;M428/M429/M430 模式变化仍由 WASM Task/TP 同步边界约束;队列容量由 `sim_linuxcnc_tp_queue_capacity` 读取,按真实 `TP_DEFAULT_QUEUE_SIZE` 限流。1000 tick 连续性回归中,除启动第 1 tick 外 `program_status=running && queue_depth=0` 的次数为 `0`;第 82 行附近仍保持 31 段前瞻队列。
## 当前未闭合项
以下项目仍明确记录为 `blocked_by_abi`,没有伪造通过:
@@ -163,6 +170,26 @@ bash -n run-5axis-rtcp.sh
本轮结果:WASM 构建通过,原生 CTest 22/22 通过,XYZAC 聚合按钮测试通过,3D_Chips 固定 tick 长程序测试通过。Jog Speed、Max Velocity、Spindle Override 已改为 WASM TP/IO 状态和命令;前端运行态不再使用 React 默认值。发布站点 UI 运行/暂停/恢复/停止也已在 Chromium 仿真环境执行;Safari 和真实物理断电不属于本项目范围。
本轮连续性修复后,`3D_Chips.ngc` 3000 tick 执行到第 337 行,`running_queue_gaps=0`;这证明长距离运行中的中间停顿已不再由 Worker 队列饥饿制造。
发布站点 r10 连续性验证:
```text
url: https://49.232.250.35:58010/
release: 20260902-linuxcnc-wasm-continuous-r10
resource_sha256: index-Byst0JhC.js 26d3f21f496c8223218761ba641dab8b4f36fd18892f260c7bf5b5cfa83cafec
sim-worker-entry-BTVfbu6g.js adf2ac5621ba388408f31ceab4bbcbfa6ba2923577d8eb69aa79ea54f3be0134
linuxcnc-sim-core-B2786u4k.wasm 3163f5ff63c5f3e1d2c07d1d948fce328bf3ad919eee188e432f7ba57468fc71
3D_Chips.ngc: loaded -> POWER -> HOME ALL -> RUNNING
sampled_running_frames: 33
queue_gaps: 0
first_running: current_line=62, queue_depth=3, velocity=20, active_id=16
last_running: current_line=69, queue_depth=2, velocity=16.6666666667, active_id=17
browser_errors: 0
screenshot: /tmp/published-r10-continuous.png
screenshot_sha256: c93fd23e648e49bfa9359af245372f03f3fccee123497909f3dcc005f5a59749
```
发布站点 r5 浏览器冒烟:
```text
@@ -178,7 +205,7 @@ and view controls: clicked with no browser errors
output_sha256: bdf705473e6cda94d721aa23329257adf4a68b705add7650da5cc47012ab70b0
```
发布站点 r6(本轮 WASM authority 版本)浏览器验收:
发布站点 r6(历史 WASM authority 版本)浏览器验收:
```text
url: https://49.232.250.35:58010/
@@ -194,6 +221,8 @@ screenshots: /tmp/published-r6-authority.png (e58205228a04b386c7b7514bf03c71df7b
/tmp/published-r6-running.png (7fc474d0cb31a0fdd4afb198061e9812c753684e3d2963cc004ec4483c5c4990)
```
当前发布资源为 r10;r6 资源 hash 仅作为历史记录保留。
发布站点 r7(IDENTITY/TCP: XYZAC/USERK 切换版本)浏览器验收:
```text
@@ -214,10 +243,12 @@ panel_button_test_output 9bddcd8b0219925e00598e081dc7a4ed0f4868e8822a21f0ccd08d8
button_constraints_output 5b6f4ce1dec03764dcb234793ff96fc2f04d15ab954620a44dbb1210ec64a5a5
feed_authority_output deab4a51ee0e56d4f8134efba4b7a97a2b88f37d9165cf730207f71886df8526
3d_chips_test_output c97caef2ea5cf3841e1238ec443d0eebadad8cb0048af829111c06e99c9fcdd7
3d_chips_no_gap_output c97b5fbb43a6e81a8ee15272bf71aa75ec0ba79be28a34f30b4221d50251c77d
wasm_io_source 1cb066d185dd2c5bbf435e022c2518483bd44962e5a0303248757b2da51740f7
wasm_io_c_source 09bce1430d6f71702ca0b3bf29ac50db377a6f232ce0d1a9b2c1eaac7ea2162e
panel_button_test_source 80782fc1f85f88beb48ec3dfaf638a93f2edb912e694840199dbff504477fe74
switchkins_direct_test_output 24e6cb8ec1195a97f71294b49217db0cbc0d7c3ecfa4bc8aa244ba3921c816a7
panel_r10_output 9bddcd8b0219925e00598e081dc7a4ed0f4868e8822a21f0ccd08d8e9d355d45
```
报告对应提交前工作树保留了既有 coverage 大文件和 LinuxCNC 子模块改动;本轮提交包含 WASM TP/IO/HOME authority、无 JS JOG 运动计算、前端 pending 投影、长程序快照性能修正、聚合测试和本报告。