Skip to content

Fix remaining Windows chat-app tests and CUDA TTS cancel validation #759

Closed

Description

@leehack

Current scope — 2026-10-25

The Windows test-portability lane is merged; CUDA TTS cancellation remains. Linux GStreamer documentation and parity-tool accounting were fixed by #1291 (1326d1264); the basic-app empty-answer case was fixed by #1382. #1379, #1380 and #1381 are closed.

1. Windows chat-app tests — completed in main

#1414 landed through batch #1420. Actual Windows Server 2022 validation passed 664 tests / 11 skipped / 0 failed. Fresh combined macOS chat tests passed 674 / 4 skipped, with 127 Chrome tests. The fix uses host-native paths and deterministic integrity cancellation, preserving the deadlines and assertions. Only three physical-iOS POSIX filesystem fixtures skip on Windows; parser/safety checks remain enabled.

Historical failure

The earlier Windows run on stock WS2022 with the #1396 LiteRT repin recorded 659 pass, 8 skipped, 8 fail:

File Failing cases
test/litert_lm_benchmark_app_test.dart Relative model names resolved from app documents
test/model_download_controller_adapter_test.dart Cached entries, Web-specific model source, refresh/progress forwarding
test/model_service_test.dart Integrity-verification cancellation
test_vm/physical_ios_speech_e2e_support_test.dart Three canonical filesystem/output-path cases
  • Diagnose and fix Windows path assumptions and integrity-cancellation fixture timing.
  • Pass flutter test test test_vm on Windows and the affected non-Windows suites. Preserve cancellation and filesystem guarantees rather than weakening assertions or deadlines to hide failures.

2. CUDA/Windows TTS decode-cancel gate — separate follow-up

The historical gate can fail from reference-decode timing spread or an early timer. #1387 adds cancel-landing diagnostics, not the margin/timer repair.

  • Reproduce on CUDA/Windows, use the landing evidence to distinguish real decode cancellation from frame-step or post-completion samples, and fix the measured margin/timer cause.
  • Verify in-flight cancellation and recovery on the affected backend; retain truthful NOT_RUN results when decode cancellation was not exercised.

The CUDA lane is not a blocker for the selected Windows test-portability slice. #627 owns final-decode targeting; #922 owns release scope.

Activity

  1. added
    bug
    priority:P3
    on Sep 27, 2026
  2. leehack commented on Oct 24, 2026

    @leehack
    OwnerAuthor

    Split the self-verifiable items into filler issues: #1379 (Linux GStreamer docs), #1380 (basic_app empty answer), #1381 (parity tool counts only content). The Windows test-path failures and the CUDA TTS decode_cancel flake stay here.

  3. leehack commented on Oct 24, 2026

    @leehack
    OwnerAuthor

    Correction: the GStreamer docs and the parity tool were already fixed by 1326d12, so #1379 and #1381 are closed. #1380 (basic_app empty answer) is still open.

  4. added
    filler
    on Oct 24, 2026
  5. leehack commented on Oct 24, 2026

    @leehack
    OwnerAuthor

    Status against main e62dcc3:

  6. leehack commented on Oct 24, 2026

    @leehack
    OwnerAuthor

    Windows chat_app flutter test test test_vm on stock WS2022 (GCE, main + LiteRT v0.18.1-4 repin #1396): 659 pass, 8 skipped, 8 fail.

    • test/litert_lm_benchmark_app_test.dart: LiteRT-LM benchmark backend selection resolves relative model names from app documents when requested
    • test/model_download_controller_adapter_test.dart (ChatAppModelDownloadManager): returns cached entries without calling the chat app downloader; uses web-specific model source when requested; refresh downloads through the chat app service and forwards progress
    • test/model_service_test.dart: cancellation interrupts integrity verification
    • test_vm/physical_ios_speech_e2e_support_test.dart (Canonical speech filesystem layout): canonicalizes cache paths after runtime resolution; writes exclusively and deletes only the canonical output; canonicalizes layout when asrAudio and liteRtAsrAudio share the same file and digest

    Evidence: llamadart-evidence/litert-repin-0.18.1-4/windows/.

  7. changed the title [-]Example and tooling gaps from the pre-release sweep (Linux deps, basic_app, parity test, Windows chat_app tests, TTS cancel gate)[/-] [+]Fix remaining Windows chat-app tests and CUDA TTS cancel validation[/+] on Oct 25, 2026
  8. leehack commented on Nov 7, 2026

    @leehack
    OwnerAuthor

    Windows chat-app re-check on main c601060 (no Windows CI lane guards it): flutter test test test_vm on stock WS2022 (GCE e2-standard-4) passed 679 / 15 skipped / 0 failed. Skips are 5 Web-only tests and 10 explicit Platform.isWindows POSIX/symlink/hardlink fixtures from #462 and #1414. macOS on the same SHA: 689 / 8 skipped / 0 failed. No new Windows regressions since #1414, so no PR.

    Only section 2 (CUDA/Windows TTS decode_cancel margin/timer) remains; it needs a CUDA host.

  9. leehack commented on Nov 7, 2026

    @leehack
    OwnerAuthor

    Linux CUDA decode_cancel run: 9 PASS and 3 NOT_RUN out of 12, with no FAIL. All 3 NOT_RUN are the timer-early harness bug that #1775 fixes.

    Setup

    • Run tts759-20261107-1019, on one L4 in a g2-standard-8 VM with driver 580.
    • Release PR Prepare core and Apple companion 0.18.0 release #1746 at d14513ae, native v0.8.0-3, validation.dart speech --pack tts --backend cuda.
    • 12 packs. CUDA and 99 GPU layers were confirmed on every run.

    Timer-early NOT_RUN: 3/12. Runs r02, r05 and r12 issued the cancel 0.20–0.31 ms before the lead. This happens far more often on this host than the earlier estimate of about 1%.

    Margins on the 9 PASS runs

    • reference spread: 2.8–5.0 ms
    • margin: 14.0–14.9 ms
    • lead minus target: +0.15 to +0.84 ms

    The Windows failure, a 21 ms spread against a 42 ms margin, did not reproduce on Linux CUDA.

    Where the cancel lands: perf traces put all 6 traced cancels inside the native decode (in_decode). CUDA code2wav is interruptible here: the cancelled syntheses saved about 32 ms of a 140 ms decode.

    Conclusion: with #1775 merged, the Linux CUDA gate should pass. The Windows margin FAIL is Windows-specific; a Windows L4 run (stage 2) follows.

    Evidence:

    • gs://llamadart-cuda761-results/tts759/tts759-20261107-1019/
    • summary.json, sha256 50fde925…
    • results.tgz, sha256 3c8f8d12…
    • The VM deleted itself; cost is about $0.5–0.9.
  10. leehack commented on Nov 7, 2026

    @leehack
    OwnerAuthor

    Windows CUDA decode_cancel run: reproduced, 8 PASS / 4 FAIL out of 12, and every FAIL is a false negative.

    Setup: run tts759w-20261107-1102, Windows Server 2022, one L4 with driver 596.86. Same core (d14513ae), native v0.8.0-3, model and pack as the Linux run.

    Run Reference spread Margin (2×spread) Saved by cancel Result
    r04 19.2 ms 38.5 ms 35.2 ms FAIL
    r07 18.2 ms 36.5 ms 35.0 ms FAIL
    r11 22.0 ms 43.9 ms 41.6 ms FAIL
    r12 20.2 ms 40.4 ms 31.8 ms FAIL
    8 PASS runs 5.6–17.0 ms 16–34 ms 23–45 ms PASS

    Findings

    • The cancel works on Windows. It saved 31–45 ms of a ~160 ms decode in every run, the same as on Linux (~32 of ~140 ms).
    • What differs is the timing spread: the uncancelled reference decodes vary by 5.6–22 ms on Windows, against 2.8–5.0 ms on Linux.
    • That spread breaks the gate: the margin is twice the spread, so once the spread passes ~18 ms, the margin outgrows the fixed ~35–40 ms saving and the gate fails.
    • No early-timer misses here. None of these runs hit the problem #1775 fixes.

    Proposed harness fix, in speech_runner.dart: make the margin robust to Windows scheduling jitter, without loosening what a real in-decode cancel must show:

    • cancel earlier in the decode so the saving grows;
    • and/or take more reference decodes and use a robust spread, such as a trimmed spread or IQR, instead of max minus min.

    The runtime needs no change.

    Evidence: gs://llamadart-cuda761-results/tts759/tts759w-20261107-1102/; results.zip sha256 6594e430….

    Cost: two Windows attempts. The first died at setup because the image has no Python; I added a pinned embeddable Python. About $1.5 in total, and both VMs deleted themselves.

  11. leehack commented on Nov 7, 2026

    @leehack
    OwnerAuthor

    L4 reruns at #1775 head 7d852b8f, which cancels a tenth of the way into the decode:

    Host Before At the new lead Saved by cancel Reference spread
    Linux (tts759b-20261107-1206) 9 PASS / 3 NOT_RUN 12/12 PASS 45–56 ms 1.8–5.9 ms
    Windows (tts759w-20261107-1235) 8 PASS / 4 FAIL 10 PASS / 2 FAIL 33–61 ms 7.4–26.6 ms

    Linux is fixed.

    Windows still fails on 2 of 12 runs:

    • r04: saved 41.7 ms against a margin of 41.9 ms;
    • r08: saved 33.4 ms against a margin of 36.2 ms.

    The offline replay predicted 48–70 ms saved on Windows, but real Windows savings ranged from 33 to 61 ms. The spread between the reference decodes also widened, to as much as 26.6 ms.

    Next: offline analysis of these runs before any further paid GPU run. Evidence: gs://llamadart-cuda761-results/tts759/.

  12. leehack commented on Nov 7, 2026

    @leehack
    OwnerAuthor

    Decode-cancel gate qualified on CUDA, Linux and Windows: at #1775 head f5a59674, decode_cancel passed 12/12 on each host.

    The gate now does three things:

    • runs one untimed warm-up decode;
    • times 8 reference decodes;
    • applies a margin of 0.9× their range, cancelling a tenth of the way into the decode.
    Host Pass Spread across references Margin Saved by cancel
    Linux L4 (tts759c-20261107-1408) 12/12 1.3–3.9 ms 13.9–14.5 ms 51–54 ms
    Windows L4 (tts759w-20261107-1440) 12/12 7.8–21.2 ms 16.8–19.1 ms 41–67 ms

    On Linux, perf traces confirm every traced cancel stopped the native decode. The early-timer flag is gone.

    Next: #1775 merges once CI passes on its update onto main. That closes the CUDA cancel part of this issue.

  13. leehack commented on Nov 7, 2026

    @leehack
    OwnerAuthor

    Both parts are done:

    Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfillerpriority:P3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions