Skip to content

Add llama_dart_context_attach_threadpool for a persistent CPU threadpool - #251

Merged
leehack merged 5 commits into
mainfrom
android-threadpool-attach
Nov 29, 2026
Merged

leehack merged 5 commits into
mainfrom
android-threadpool-attach

Conversation

@leehack

@leehack leehack commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Adds a native-owned persistent ggml CPU threadpool per context (candidate tag v1.1.0-2; nothing tagged or published).

llamadart leaves llama_context.threadpool == NULL, so ggml-cpu starts and joins a pthread pool for every graph compute. On Tensor G6 (Linux 6.12, sched_pixel) the fresh workers stack onto one core and CPU generation drops to ~4 tok/s.

What

  • llama_dart_threadpool_api_version() (1) and llama_dart_context_attach_threadpool(ctx, poll): creates pools sized from llama_n_threads/llama_n_threads_batch (one pool when equal, else two with the generation pool created paused, as upstream common_threadpools::init) via ggml_backend_reg_get_proc_address(cpu_reg, ...), then llama_attach_threadpool. poll in [0,100]; other params are ggml_threadpool_params_default. Returns 1 attached / 0 CPU backend has no pool exports (ctx unchanged) / -1 error (ctx NULL or untracked, poll > 100, creation failure, teardown started; llama_dart_last_error). Idempotent.
  • Guarded call in flight. Pools and their registry entry are created in one guarded call; a context freed meanwhile is not attached and the new pools are freed.
  • Lifetime: pools belong to the context. llama_dart_exit_untrack / llama_dart_owner_untrack detach and free them (the caller frees the context); re-tracking an address drops a stale entry (documented limit: that drop frees the pools without detaching, so the old context must already be freed; llama_dart_exit_untrack is not a call in flight). llama_dart_exit_free_context removes them from the registry first, calls llama_free, then releases them, so llama_dart_exit_free, owner release and exit teardown free them after llama_free.
  • Draft context of llama_dart_speculative_init: for a target with pools, shares them only when both thread counts match exactly (reference counted), else gets its own pools with the same poll, freed after llama_free(ctx_dft). A target without pools gives its draft none.
  • Export gate (119), docs/v110_2_wrapper_rebuild.md, AGENTS.md pointer, README section, CMake test target and CI target/regex lists (Linux contract lane, macOS exit-teardown lanes incl. ASan).
  • Test-only observer (llama_dart_threadpool_test_hooks.h, LLAMADART_TESTING only) reports llama_free (1) and pool release (2) so the free order is assertable.

Risk: high (native/FFI, exit teardown). Needs independent auditor-deep at this head; not self-certified.

Validation

tests/threadpool_test.cpp (synthetic GGUF fixtures from exit_teardown_test; no ggml log strings): a sampler thread polls the process thread list while 60 decodes run.

  • attach adds exactly the pool workers (3 for 4/4, 3+1 for 4/2); no thread appears during decodes; workers gone after llama_dart_exit_free; idempotent second call; -1 for NULL, untracked, poll 101, freed ctx; owner-release and llama_dart_exit_teardown paths; draft with equal counts adds none, unequal adds one pool and frees it; free order llama_free before pools.
  • Control disposable: without a pool the sampler sees transient workers.
  • Linux x64 (GCE n2d-standard-4, Ubuntu 24.04, Debug, -DGGML_OPENMP=OFF, Mesa lavapipe installed as on the CI runner), head c500877: threadpool ctests 12/12; speculative-own/shared 30x each plus every scenario 20x pinned to 1 CPU (taskset -c 0) and to 2 CPUs: 0 failures (CPU pinning, not a cgroup quota, is what exposes the race). Before the fix speculative-* failed intermittently on x64 (the joined sampler thread, still listed in /proc/self/task, counted as a worker).
  • Linux arm64 Debug (Ubuntu 24.04 container, pthread, -DGGML_OPENMP=OFF): full wrapper-contract ctest 117/117 (1 skipped). macOS arm64 RelWithDebInfo + ASan, CI regex owner_|model_fd|threadpool|exit_teardown|...: 97/97. python3 -m unittest discover -s tests: 517 OK.
  • Exact-thread-list assertions are Linux only; other platforms start library threads of their own, so macOS checks worker counts, worker removal and free order.
  • Failing first: the sampler assertion is the one that fails when llama_attach_threadpool is dropped (equivalent to the previous disposable behaviour); the API itself did not exist before.
  • Mutations, each killed by a named assertion (Linux):
    • drop llama_attach_threadpool: without(seen, attached).empty() (attach-*), without(decode_sampled(...), with_draft).empty() (speculative-*)
    • free pools before llama_free: take_events() == {1, 2} (attach-*, owner, teardown)
    • skip pool free: workers_gone(...) (all scenarios), draft workers_gone(without(with_draft, attached))
    • skip draft sharing: with_draft == attached (speculative-shared)
    • skip draft attach: draft decode sampler assertion (speculative-*)
    • untrack keeps pools / untrack without detach: untrack scenario (take_events() == {2}, decode after untrack)
    • Re-run at c500877 on Linux x64: all seven killed.
  • validate_exports.py --format readelf on the Android arm64 libllamadart.so built from this branch: 119 required exports.

Device gate (DDP, personal account, no GCE)

Candidate Android arm64 bundle built from head a47080d (the later commits change tests and untrack only, not the attach/decode path) (build.py arm64 path, CPU backends only, NDK 28.2.13676358; nothing published), probe through llama_dart_model_load_from_file + llama_dart_init_from_model + llama_dart_context_attach_threadpool(ctx, 50) + llama_dart_exit_free. Qwen3.5-0.8B-Q4_K_M, t=4, 32 tokens. Session session-4fdb07e2-ac63-4882-aa9f-53e03aca1d4d (project llamadart-cuda-qa-20260916, artifacts under gs://llamadart-cuda-qa-20260916-devicerun/automation/sessions/session-4fdb07e2-ac63-4882-aa9f-53e03aca1d4d/), all 3 jobs PASSED.

Device Persistent gen tok/s (3 runs) gen_nivcsw Disposable control (same bundle) Gate
cubs-37 (Pixel 11, G6) 56.8 / 58.0 / 53.4 28 / 40 / 67 3.75 tok/s, nivcsw 7548 PASS (>= 30, < 1000)
grizzly-37 (Pixel 11 Pro, G6) 54.5 / 57.6 / 55.7 35 / 21 / 33 3.93 tok/s, nivcsw 7334 PASS
caiman-35 (Pixel 9 Pro, G4) 36.6 / 36.9 / 36.5 68 / 96 / 48 24.0 tok/s PASS (>= 30, above 21 baseline)

No-regression, draft context beside the target (llama_dart_speculative_init with the model as its own draft, one draft decode per generated token; shares the target pools):

Device Persistent Disposable
cubs-37 28.3 tok/s, nivcsw 230 2.14 tok/s, nivcsw 13128
grizzly-37 29.4 tok/s 1.89 tok/s
caiman-35 18.5 tok/s 12.0 tok/s

Probe, scripts, raw logs: local ~/ddp-evidence/wk (not in the repo). Cost: no GCE; DDP is not billed per-run through the API, 1 session of 3 device jobs (~10 min each); ~0.7 GB temporary GCS objects deleted afterwards.

Not run / open

  • CI at this head (Windows, Android validate, Apple lanes); ASan on Linux; real device in the llamadart app (Dart side is a separate change).
  • Publication of v1.1.0-2 and downstream adoption are approval-gated and not started.

Changelog

Native: add llama_dart_context_attach_threadpool for a persistent CPU threadpool per context (fixes CPU generation collapsing to ~4 tok/s on Tensor G6).

…tracked contexts

The joined sampler thread stays listed in /proc/self/task for a moment, so an
exact thread-list comparison right after a sample, or the next sampler, saw it
as a worker. The sampler now waits for its own thread to leave the list, and the
post-decode checks settle.

An untracked context is freed by its caller, so its pools are detached and
freed at untrack; re-tracking an address drops the stale entry. The speculative
test decodes the draft context so a missing draft attach is caught.
@leehack
leehack marked this pull request as ready for review November 29, 2026 02:30
@leehack
leehack merged commit b78a2de into main Nov 29, 2026
29 checks passed
leehack added a commit to leehack/llamadart that referenced this pull request Nov 29, 2026
…ative v1.1.0-2) (#2393)

## Summary

- Repin the llama.cpp runtime from `v1.1.0-1` to [llamadart-native
v1.1.0-2](https://github.com/leehack/llamadart-native/releases/tag/v1.1.0-2)
([PR #251](leehack/llamadart-native#251),
`b78a2de`): `llamaCppTag`, all 11 bundle SHA-256s, the Windows CUDA
sidecar, the XCFramework checksum and the Apple companion
`Package.swift` tag/checksum, plus the exact-tag lists and Android
qualification pins that follow the pin (as in #2375).
`check_native_release_digests.dart` matches `SHA256SUMS` (12 bundles).
Same llama.cpp `v1.1.0` commit, so admission is unchanged. Bindings gain
`llama_dart_threadpool_api_version` and
`llama_dart_context_attach_threadpool`, added by hand: local ffigen on
macOS also rewrites the `FILE` types, so I kept only the two additive
declarations. A Linux `sync_native_bindings.yml` run was not done; the
`native_symbol_integration_test.dart` signature test pins both
declarations.
- Root cause (plan
[#2390](#2390)): llamadart
left `llama_context.threadpool` unset, so ggml starts and joins a worker
pool for every graph compute; on Tensor G6 (Linux 6.12) the fresh
workers stack onto one core and CPU generation drops to about 4 tok/s.
- New `lib/src/backends/llama_cpp/context_threadpool_api.dart`
(`ContextThreadpoolApi`) resolves the two exports as one unit (version
>= 1) and `LlamaCppObjectCalls.attachContextThreadpool` calls it.
`_createOwnedContext` attaches after every context it creates,
owner-created or not, with poll 50, so it covers the generation,
embedding, reranking, TTS/ASR host and decision-encoder contexts. The
thread counts are the ones the context was created with
(`numberOfThreads`/`numberOfThreadsBatch`, `0` through
`resolveCpuThreads`). The speculative draft context is created and
attached natively; Dart attaches nothing to it. The pools belong to the
wrapper, which frees them after the context, so Dart frees nothing new.
- Version skew: a runtime without the exports (a `v1.1.0` or `v1.1.0-1`
override) keeps ggml's per-compute pool and loads as before. A status of
`0` or `-1` (or a value a later release adds) is logged at debug level
and never fails the load.
- Companion/Apple: no companion version changed. The pin sync moved
`llamaCppAppleCompanionVersion` to `0.23.1` and added `## Unreleased` to
the companion changelog. `verify_release_docs_versions.dart` passes with
a pending companion bump (same as #2375). `--release-prep` fails by
design on three findings: the companion `0.23.0` publishes `v1.1.0-1`;
the published `llamadart_llama_cpp_flutter-v0.23.0` pins `v1.1.0-1`
which this core accepts no more; and the new pin needs a companion core
floor past the rejecting `0.23.0`. The 0.23.1 release prep owns the
companion bump and floor
([#2390](#2390)).

## Changelog

- [core] llama.cpp contexts now keep a persistent CPU threadpool
(`llamadart-native` v1.1.0-2), which fixes CPU generation on Android
Tensor G6 (Pixel 11) running at about 4 tokens per second, now about 14x
faster.
- [packages/llamadart_llama_cpp_flutter] Pin Apple SwiftPM to
`leehack/llamadart-native@v1.1.0-2`.

## Production-readiness scope
- **User-facing scope:** every llama.cpp context on every native
platform gets a persistent ggml CPU threadpool sized by its thread
counts, instead of a disposable pool per graph compute. Device runs of
the native candidate (Qwen3.5-0.8B Q4_K_M, 4 threads): Pixel 11 / 11 Pro
about 4 to about 55 tok/s, Pixel 9 Pro 24 to 37 tok/s (native gate
results are in leehack/llamadart-native#251).
- **Supported platforms/paths:** all default native bundles, the Windows
CUDA sidecar and Apple SwiftPM source. Windows resolves the exports from
the wrapper asset.
- **Unsupported or intentionally unavailable paths:** a runtime override
older than `v1.1.0-2`, or a CPU backend without ggml threadpool exports
(`0`), keeps the per-compute pool with a debug log; a refusal (`-1`) is
logged and the context still loads.
- **Out of scope / follow-ups:** companion bump and core floor (0.23.1
release prep, #2390); a Studio Android APK run on device;
Windows/Linux/CUDA smokes (release-plan lanes).

## Completeness checklist
- [x] Declared scope is fully implemented.
- [x] Unsupported/version-skew path: absent exports, version 0, `0`,
`-1`, unknown status; tests below.
- [x] README, website docs (known platform issues, performance tuning,
native sync), `doc/llama_cpp_exit_teardown.md` and the PR changelog
section are updated. `skills/` needs no change: no public API or option
changed.
- [x] Regression coverage: see Test Plan.
- [x] Capability registry: N/A, no public capability.
- [x] No secrets, tokens or signed URLs.
- [x] Follow-ups tracked in #2390.

## PR type guidance
- **Bugfix PR:** root cause above (per-compute worker pools stacking on
one core). Regression tests: `context_threadpool_api_test.dart`,
`llama_cpp_service_context_threadpool_test.dart`,
`native_symbol_integration_test.dart`. Affected platforms: Android arm64
(device-verified natively), all others get the same pool.
- **Runtime artifact repin:** digests match `SHA256SUMS`;
`check_webgpu_bridge_tag.dart --verify-manifest` passes with bridge
assets unchanged at `v0.1.96`.

## Test Plan
- [x] `dart run tool/prepare_workspace.dart`
- [x] `python3 tool/ci/check_format.py` (0 changed), `dart analyze` (no
issues), `check_platform_boundaries.dart`
- [x] `dart test -p vm -j 1 --exclude-tags local-only` (isolated TMPDIR,
macOS arm64): 16,635 passed, 136 skipped
- [x] `dart test -p chrome --exclude-tags local-only`: 5,418 passed, 1
skipped
- [ ] `coverage-lib`: not run; the new files are exercised by the new
tests except the Windows wrapper-asset branch of `tryResolve`, which
only resolves on Windows.
- [x] Native Python suites (160 pin, 14 archive, 23 header/bindings, 5
SD bindings), default-consumer fixtures (70), Android `test_prepare.py`
(3) and `packages/llamadart_validation` Android tests (27),
`check_native_release_digests.dart`, `check_webgpu_bridge_tag.dart
--verify-manifest`, `verify_release_docs_versions.dart` (default passes
with the pending companion bump; `--release-prep` fails as described),
`./tool/docs/build_site.sh`
- [x] New tests (fake and real native): attach exactly once per owned
context after creation and before the first decode, with the creation
thread counts (explicit 2/3 and host-derived), poll 50, on generation,
reranking, decision-encoder and worker-owner contexts; absent exports
and `0`, `-1` and unknown statuses still load and generate; a failed
creation attaches nothing; the real bundle attaches (`1`) and everything
is freed once and in order.
- [x] Mutation checks, 11 of 11 killed: drop the call; attach to a null
context; skip the owner path; treat `-1` as fatal; poll 0; resolve
without the exit-teardown API; minimum version 0; ignore the version;
unknown status as success; wrong poll argument; wrong batch thread
count.
- [ ] Local-only real-model check: not added; the repo's thread-list
probes are native-repo tests (`llamadart_threadpool_test` in
llamadart-native). The Dart tests above run the real runtime on a
synthetic model.

## Matrix Evidence

| Matrix row | Scope covered | Platform / model / backend | Result |
Evidence / notes |
| --- | --- | --- | --- | --- |
| `static-format-analyze` | format, analyzer, boundaries | macOS arm64 /
Flutter 3.47.1 | PASS | No analyzer issues |
| `root-vm` | VM suite | macOS arm64, isolated TMPDIR | PASS | 16,635
passed, 136 skipped |
| `root-chrome` | browser suite | Chrome | PASS | 5,418 passed, 1
skipped |
| `native-release-digests` | archive digest pins | Published v1.1.0-2 |
PASS | 12 bundles match `SHA256SUMS` |
| `webgpu-bridge-tag-consistency` | pins, provenance | GitHub / npm |
PASS | `--verify-manifest` |
| `native-sync-python-suites` | sync Python suites | Python 3 | PASS |
160 + 14 + 23 + 5 |
| `release-doc-version-consistency` | docs versions | Checkout v1.1.0-2
| PASS (default) | `--release-prep` fails by design, owned by 0.23.1
prep |
| `docs-site` | site build, links | Jaspr | PASS | Build exit 0 |
| `coverage-lib` | lib coverage | N/A | Not run | See Test Plan |
| `native-default-consumer-aot`, `macos-arm64-runtime-smoke`,
`native-exit-teardown`, `windows-x64-ci-runtime`, device and web smokes
| real-runtime smokes | N/A | Not run | Release-plan lanes under #2390 |
| `high-risk-exact-head-independent-qa` | independent blocking review of
exact head | Draft PR | Pending | Required before ready |

## Review Notes
- Independent review status: pending (auditor-deep, independent of this
implementation).
- CI status / head SHA: pending /
147afa9. The first head's Linux VM 2/3
and Windows runtime jobs failed on two new tests (an isolate closure
that captured the enclosing service, and the bindings probe lacking the
Windows wrapper asset); fixed in the tests only, no production change.

## High-risk regression review
- **Classification:** high-risk (`artifactConsumer`, `backendRuntime`,
`regressionPolicy`)
- **Implementation task:** this worker thread
- **Independent blocking QA task:** pending
- **Exact head / current base:**
147afa9 /
bcaaa76
- **Production-branch deletion, bypass, or miswire proof:** pending
audit; mutations above show deleting or bypassing the call fails tests
- **Affected-family real-model/artifact evidence:** native device gate
in llamadart-native#251; here a synthetic model on the real runtime
- **Known PR-caused P1 regressions:** 0
- **Unresolved review threads:** 0

Refs #2390.
leehack added a commit to leehack/llamadart that referenced this pull request Nov 29, 2026
…amadart-native v1.1.0-2) (#2442)

## Summary
Backport of #2393
(cherry picked from commit e95e5c7)

- Repin the llama.cpp runtime from `v1.1.0-1` to [llamadart-native
v1.1.0-2](https://github.com/leehack/llamadart-native/releases/tag/v1.1.0-2)
([PR #251](leehack/llamadart-native#251),
`b78a2de`): `llamaCppTag`, all 11 bundle SHA-256s, the Windows CUDA
sidecar, the XCFramework checksum and the Apple companion
`Package.swift` tag/checksum, plus the exact-tag lists and Android
qualification pins that follow the pin (as in #2375).
`check_native_release_digests.dart` matches `SHA256SUMS` (12 bundles).
Same llama.cpp `v1.1.0` commit, so admission is unchanged. Bindings gain
`llama_dart_threadpool_api_version` and
`llama_dart_context_attach_threadpool`, added by hand: local ffigen on
macOS also rewrites the `FILE` types, so I kept only the two additive
declarations. A Linux `sync_native_bindings.yml` run was not done; the
`native_symbol_integration_test.dart` signature test pins both
declarations.
- Root cause (plan
[#2390](#2390)): llamadart
left `llama_context.threadpool` unset, so ggml starts and joins a worker
pool for every graph compute; on Tensor G6 (Linux 6.12) the fresh
workers stack onto one core and CPU generation drops to about 4 tok/s.
- New `lib/src/backends/llama_cpp/context_threadpool_api.dart`
(`ContextThreadpoolApi`) resolves the two exports as one unit (version
>= 1) and `LlamaCppObjectCalls.attachContextThreadpool` calls it.
`_createOwnedContext` attaches after every context it creates,
owner-created or not, with poll 50, so it covers the generation,
embedding, reranking, TTS/ASR host and decision-encoder contexts. The
thread counts are the ones the context was created with
(`numberOfThreads`/`numberOfThreadsBatch`, `0` through
`resolveCpuThreads`). The speculative draft context is created and
attached natively; Dart attaches nothing to it. The pools belong to the
wrapper, which frees them after the context, so Dart frees nothing new.
- Version skew: a runtime without the exports (a `v1.1.0` or `v1.1.0-1`
override) keeps ggml's per-compute pool and loads as before. A status of
`0` or `-1` (or a value a later release adds) is logged at debug level
and never fails the load.
- Companion/Apple: no companion version changed. The pin sync moved
`llamaCppAppleCompanionVersion` to `0.23.1` and added `## Unreleased` to
the companion changelog. `verify_release_docs_versions.dart` passes with
a pending companion bump (same as #2375). `--release-prep` fails by
design on three findings: the companion `0.23.0` publishes `v1.1.0-1`;
the published `llamadart_llama_cpp_flutter-v0.23.0` pins `v1.1.0-1`
which this core accepts no more; and the new pin needs a companion core
floor past the rejecting `0.23.0`. The 0.23.1 release prep owns the
companion bump and floor
([#2390](#2390)).

## Changelog

- [core] llama.cpp contexts now keep a persistent CPU threadpool
(`llamadart-native` v1.1.0-2), which fixes CPU generation on Android
Tensor G6 (Pixel 11) running at about 4 tokens per second, now about 14x
faster.
- [packages/llamadart_llama_cpp_flutter] Pin Apple SwiftPM to
`leehack/llamadart-native@v1.1.0-2`.

## Production-readiness scope
- **User-facing scope:** every llama.cpp context on every native
platform gets a persistent ggml CPU threadpool sized by its thread
counts, instead of a disposable pool per graph compute. Device runs of
the native candidate (Qwen3.5-0.8B Q4_K_M, 4 threads): Pixel 11 / 11 Pro
about 4 to about 55 tok/s, Pixel 9 Pro 24 to 37 tok/s (native gate
results are in leehack/llamadart-native#251).
- **Supported platforms/paths:** all default native bundles, the Windows
CUDA sidecar and Apple SwiftPM source. Windows resolves the exports from
the wrapper asset.
- **Unsupported or intentionally unavailable paths:** a runtime override
older than `v1.1.0-2`, or a CPU backend without ggml threadpool exports
(`0`), keeps the per-compute pool with a debug log; a refusal (`-1`) is
logged and the context still loads.
- **Out of scope / follow-ups:** companion bump and core floor (0.23.1
release prep, #2390); a Studio Android APK run on device;
Windows/Linux/CUDA smokes (release-plan lanes).

## Completeness checklist
- [x] Declared scope is fully implemented.
- [x] Unsupported/version-skew path: absent exports, version 0, `0`,
`-1`, unknown status; tests below.
- [x] README, website docs (known platform issues, performance tuning,
native sync), `doc/llama_cpp_exit_teardown.md` and the PR changelog
section are updated. `skills/` needs no change: no public API or option
changed.
- [x] Regression coverage: see Test Plan.
- [x] Capability registry: N/A, no public capability.
- [x] No secrets, tokens or signed URLs.
- [x] Follow-ups tracked in #2390.

## PR type guidance
- **Bugfix PR:** root cause above (per-compute worker pools stacking on
one core). Regression tests: `context_threadpool_api_test.dart`,
`llama_cpp_service_context_threadpool_test.dart`,
`native_symbol_integration_test.dart`. Affected platforms: Android arm64
(device-verified natively), all others get the same pool.
- **Runtime artifact repin:** digests match `SHA256SUMS`;
`check_webgpu_bridge_tag.dart --verify-manifest` passes with bridge
assets unchanged at `v0.1.96`.

## Test Plan
- [x] `dart run tool/prepare_workspace.dart`
- [x] `python3 tool/ci/check_format.py` (0 changed), `dart analyze` (no
issues), `check_platform_boundaries.dart`
- [x] `dart test -p vm -j 1 --exclude-tags local-only` (isolated TMPDIR,
macOS arm64): 16,635 passed, 136 skipped
- [x] `dart test -p chrome --exclude-tags local-only`: 5,418 passed, 1
skipped
- [ ] `coverage-lib`: not run; the new files are exercised by the new
tests except the Windows wrapper-asset branch of `tryResolve`, which
only resolves on Windows.
- [x] Native Python suites (160 pin, 14 archive, 23 header/bindings, 5
SD bindings), default-consumer fixtures (70), Android `test_prepare.py`
(3) and `packages/llamadart_validation` Android tests (27),
`check_native_release_digests.dart`, `check_webgpu_bridge_tag.dart
--verify-manifest`, `verify_release_docs_versions.dart` (default passes
with the pending companion bump; `--release-prep` fails as described),
`./tool/docs/build_site.sh`
- [x] New tests (fake and real native): attach exactly once per owned
context after creation and before the first decode, with the creation
thread counts (explicit 2/3 and host-derived), poll 50, on generation,
reranking, decision-encoder and worker-owner contexts; absent exports
and `0`, `-1` and unknown statuses still load and generate; a failed
creation attaches nothing; the real bundle attaches (`1`) and everything
is freed once and in order.
- [x] Mutation checks, 11 of 11 killed: drop the call; attach to a null
context; skip the owner path; treat `-1` as fatal; poll 0; resolve
without the exit-teardown API; minimum version 0; ignore the version;
unknown status as success; wrong poll argument; wrong batch thread
count.
- [ ] Local-only real-model check: not added; the repo's thread-list
probes are native-repo tests (`llamadart_threadpool_test` in
llamadart-native). The Dart tests above run the real runtime on a
synthetic model.

## Matrix Evidence

| Matrix row | Scope covered | Platform / model / backend | Result |
Evidence / notes |
| --- | --- | --- | --- | --- |
| `static-format-analyze` | format, analyzer, boundaries | macOS arm64 /
Flutter 3.47.1 | PASS | No analyzer issues |
| `root-vm` | VM suite | macOS arm64, isolated TMPDIR | PASS | 16,635
passed, 136 skipped |
| `root-chrome` | browser suite | Chrome | PASS | 5,418 passed, 1
skipped |
| `native-release-digests` | archive digest pins | Published v1.1.0-2 |
PASS | 12 bundles match `SHA256SUMS` |
| `webgpu-bridge-tag-consistency` | pins, provenance | GitHub / npm |
PASS | `--verify-manifest` |
| `native-sync-python-suites` | sync Python suites | Python 3 | PASS |
160 + 14 + 23 + 5 |
| `release-doc-version-consistency` | docs versions | Checkout v1.1.0-2
| PASS (default) | `--release-prep` fails by design, owned by 0.23.1
prep |
| `docs-site` | site build, links | Jaspr | PASS | Build exit 0 |
| `coverage-lib` | lib coverage | N/A | Not run | See Test Plan |
| `native-default-consumer-aot`, `macos-arm64-runtime-smoke`,
`native-exit-teardown`, `windows-x64-ci-runtime`, device and web smokes
| real-runtime smokes | N/A | Not run | Release-plan lanes under #2390 |
| `high-risk-exact-head-independent-qa` | independent blocking review of
exact head | Draft PR | Pending | Required before ready |

## Review Notes
- Independent review status: pending (auditor-deep, independent of this
implementation).
- CI status / head SHA: pending /
147afa9. The first head's Linux VM 2/3
and Windows runtime jobs failed on two new tests (an isolate closure
that captured the enclosing service, and the bindings probe lacking the
Windows wrapper asset); fixed in the tests only, no production change.

## High-risk regression review
- **Classification:** high-risk (`artifactConsumer`, `backendRuntime`,
`regressionPolicy`)
- **Implementation task:** this worker thread
- **Independent blocking QA task:** pending
- **Exact head / current base:**
147afa9 /
bcaaa76
- **Production-branch deletion, bypass, or miswire proof:** pending
audit; mutations above show deleting or bypassing the call fails tests
- **Affected-family real-model/artifact evidence:** native device gate
in llamadart-native#251; here a synthetic model on the real runtime
- **Known PR-caused P1 regressions:** 0
- **Unresolved review threads:** 0

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant