Add pinned CPU engine dependencies, retained interrupted-response history, provider admission, offline evaluation and isolated browser tooling. Record Phase 2 acceptance and Phase 3/4 preparation, bounded paid-test accounting and interruption incident findings. Human interruption acceptance, paired OpenAI evaluation and rollback remain pending.
164 lines
9.6 KiB
Markdown
164 lines
9.6 KiB
Markdown
# Native session conformance and memory incident — 2026-10-16
|
|
|
|
Four controlled native cases now pass: normal audio/close, SIGINT, SIGTERM and
|
|
provider failure. **110 targeted tests pass**. Phase 2 remains **in_progress**;
|
|
real component audio, browser listening and cold-start performance are not accepted.
|
|
[Machine-readable evidence](phase-02-native-session-20261016.json).
|
|
|
|
This checkpoint tests the actual pinned local pipeline, real NLTK/Silero assets,
|
|
native WebSocket server and application adapter setup verification. Only upstream
|
|
provider HTTP is replaced with fixtures. No paid request, real-provider quality
|
|
claim, operational change or audio tuning is part of these checks.
|
|
|
|
## IDE termination: observed cause
|
|
|
|
The current boot's `systemd-oomd` journal records a kill at **06:07:57 America/New_York**:
|
|
the VS Code scope `app-code-12270.scope` was killed after user-slice memory pressure
|
|
was **70.57% > 50% for over 20 seconds** with reclaim activity. That application
|
|
scope used about 2 GiB. Current-boot kernel logs also record repeated memory-pressure
|
|
cache flushing. The boot started around 04:49; the previous boot ended the day
|
|
before. Evidence establishes a userspace OOM-manager kill of the IDE, not a kernel
|
|
panic or a new system boot at the incident time.
|
|
|
|
Two native engine tests had been launched concurrently with 4 GiB limits each.
|
|
Those limits are ceilings, not measurements of actual usage. Their concurrency
|
|
coincided with the incident and plausibly contributed to host pressure; the
|
|
journal does not attribute the pressure exclusively to them. They should have
|
|
been run sequentially. Interrupted runs are not accepted as successful evidence.
|
|
After resumption no owned engine test container was running. Unrelated containers
|
|
and stopped operational services were not restarted or cleaned up.
|
|
|
|
## Safer continuation
|
|
|
|
[The guarded runner](run-image-session-smoke.py) runs one engine at a time with:
|
|
|
|
- 3 GiB container memory, swap disabled, two CPUs and 128 PIDs;
|
|
- external network disabled, read-only root/resources, dropped capabilities;
|
|
- more than 5 GiB available host memory required before starting each case;
|
|
- host available-memory sampling once per second; below 2500 MiB, stop only the
|
|
owned test container;
|
|
- a 180-second wall deadline per test and recorded commands/outcomes/headroom.
|
|
|
|
These are evaluation-container resource controls. Existing application audio
|
|
buffers, credits, speed, pipeline queue capacity and runtime deadlines are unchanged.
|
|
The runner's generated PCM fixture and local assets must already exist. Invoke
|
|
from the repository root; it does not download resources or launch operational
|
|
Compose services.
|
|
|
|
## Discovered shutdown defects and scoped correction
|
|
|
|
The earlier queue-fixed image passed a normal native speech turn, but actual
|
|
SIGINT/SIGTERM during a held fixture LLM request produced `runtime_stop=2` and
|
|
lifecycle outcome 1. Cleanup waited for native workers before cancelling the
|
|
provider I/O those workers awaited. Cleanup now closes the component gateway
|
|
before waiting for runtime stop; independent cleanup and existing budgets remain.
|
|
|
|
A lightweight regression also exposed a Python 3.13 shutdown issue: the gateway
|
|
awaited `asyncio.Server.wait_closed()` before closing accepted clients. New Python
|
|
waits for those transports, delaying request cancellation. Accepted writers/tasks
|
|
are now closed/cancelled before awaiting server closure. This changes cleanup
|
|
ordering only. The final scoped suite passed **110 tests** in 6.90 seconds;
|
|
the new regression also rejected the original lifecycle cleanup order.
|
|
|
|
Files: `services/local_s2s/lifecycle.py`, `services/local_s2s/components.py`, and
|
|
`tests/unit/test_local_s2s_repairs.py`. No provider/profile contract was changed.
|
|
The corrected image adds those two runtime files to preserved queue-fixed image
|
|
`6ad4a6a418ef`, using an offline COPY-only build. Its immutable ID is:
|
|
|
|
```text
|
|
sha256:89c7295e521903c16b8ab72f8049b8166ceeb718ac7d531b815dd5d7613dea7b
|
|
```
|
|
|
|
Tag: `rag-local-s2s-candidate:phase2-session-fix-v2`. Earlier candidate tags/images
|
|
remain intact; Compose defaults and operational selection are unchanged. The
|
|
inherited embedded build-input manifest still describes the earlier base inputs;
|
|
the correction-layer provenance is recorded separately.
|
|
|
|
## Input and evidence boundaries
|
|
|
|
[The session check](image-session-smoke.py) uses the first three seconds of the
|
|
pinned source's existing `src/speech_to_speech/TTS/ref_audio.wav`, decoded locally
|
|
by ffmpeg to mono PCM16LE at 24 kHz; one second of silence is appended in memory.
|
|
The clip stays entirely in the offline test container. It is not the user's
|
|
voice, a new recording or Persian ASR accuracy evidence. STT returns a fixed Persian
|
|
fixture transcript; LLM returns fixed Persian SSE text; TTS returns a 440 Hz test
|
|
tone. No synthesized-Persian listening claim is made.
|
|
|
|
Earlier unguarded normal runs: the first 2 GiB run timed out after response.create;
|
|
a single 4 GiB run passed. A subsequent concurrent run had provider expiry/close
|
|
errors, and its paired SIGINT run was interrupted. These are reported rather than
|
|
treated as reliable performance or successful shutdown evidence. Final acceptance
|
|
below must come only from the guarded sequential runs on the corrected image.
|
|
|
|
## Guarded native outcomes
|
|
|
|
| Case | Observed result | Outcome |
|
|
| --- | --- | --- |
|
|
| Normal session | Real Silero detects sample speech; committed input and fixture transcript share item ID; explicit response emits nonzero audio, completed transcript and successful terminal; unit releases after close | passed |
|
|
| Applied setup mismatch | Actual native model change fails application adapter attestation; restoring the correct session passes | passed in final normal run |
|
|
| Intent/item correlation | `voice_intent` preserved in created/done response; response ID and assistant item ID agree across audio/transcript events | passed in final normal run |
|
|
| SIGINT while fixture LLM is pending | Actual OS signal to engine PID; provider fixture cancelled, all cleanup counters zero, runtime stopped | passed, 0.1072 s to final cleanup |
|
|
| SIGTERM while fixture LLM is pending | Same real native path and cancellation/cleanup checks | passed, 0.2030 s to final cleanup |
|
|
| Provider HTTP 503 | Exactly one admitted generation attempt (plus constructor warmup), failed response terminal, no successful-answer terminal, unit releases and cleanup succeeds | passed |
|
|
|
|
The final normal session observed **10,752 PCM bytes / 5,376 samples**, SHA-256
|
|
`cae27dc0b5dc8cebb95531de41096371a2c091b291820f257b3f62f479df7875`.
|
|
Native setup acknowledged 24 kHz PCM. The fixture TTS tone starts with 4,800
|
|
samples; pipeline resampling/block padding changes the delivered sample count.
|
|
This establishes actual nonzero PCM transport with correlation, not natural
|
|
Persian speech or a real provider's independently verified raw sample rate.
|
|
|
|
Exactly six fixture attempts occurred in a normal turn: three constructor warmups
|
|
and one STT/LLM/TTS request. Caps were 17 tokens in this fixture process only;
|
|
operational generation limits were not changed. No response was generated before
|
|
the explicit create command. Signals observed five attempts each, because TTS was
|
|
not reached before cancellation. Failure also retained the failed terminal rather
|
|
than disguising the provider failure as a completed answer.
|
|
|
|
### Resource-dependent failures retained
|
|
|
|
The guarded one-CPU first pass had a cold-start deadline failure while lazily
|
|
importing OpenAI resource modules; actual startup's **90 s** limit was preserved.
|
|
One-core normal and provider-failure response runs later timed out while a TTS
|
|
worker was creating an SSL context. A separate SSL-only check completed in
|
|
**0.0208 s**, so these observations do not establish an intrinsically slow or
|
|
corrupt certificate bundle. With **two CPUs**, unchanged 3 GiB/no-swap/headroom
|
|
guards and unchanged application deadlines, normal/failure cases passed in
|
|
28.011/28.013 s total. The final normal run with extra mismatch/intent assertions
|
|
passed in 29.012 s. No application timeout was increased to obtain those results.
|
|
|
|
Signal cases passed under the earlier one-CPU sequential limit. Their harness
|
|
predated the additional mismatch/intent assertions; those assertions were executed
|
|
only in the final normal session. Earlier harness variants were not independently
|
|
source-snapshotted; their immutable runtime image, raw trace hashes, commands and
|
|
observed results remain recorded. The JSON fingerprints the final runnable scripts.
|
|
|
|
Minimum host available memory across the guarded first pass was about **5.14 GiB**;
|
|
the final normal run retained about **5.01 GiB**. No guard abort or newer OOM-manager
|
|
kill was observed. All owned containers were removed; unrelated services remain
|
|
untouched. These are available-host-memory measurements, not per-container peak
|
|
RAM measurements or a capacity benchmark.
|
|
|
|
Repeat from the root, only with existing resources/input/image and sufficient
|
|
host headroom:
|
|
|
|
```sh
|
|
.venv/bin/python docs/evaluation/local-s2s/run-image-session-smoke.py normal sigint sigterm failure
|
|
```
|
|
|
|
The runner writes generated logs/results under `.local-s2s-build/`; archive old
|
|
outputs before rerunning comparisons. To regenerate the local acoustic input:
|
|
|
|
```sh
|
|
ffmpeg -hide_banner -loglevel error \
|
|
-i tmp/local-s2s-upstream-619e3fe4/src/speech_to_speech/TTS/ref_audio.wav \
|
|
-t 3 -ac 1 -ar 24000 -c:a pcm_s16le -f s16le \
|
|
.local-s2s-build/session-input-24k.pcm
|
|
```
|
|
|
|
No broad/database test rerun, actual Angular/microphone session, real-provider
|
|
request, measured quality/cost acceptance or operational switch is claimed.
|
|
The next live gates require separately bounded paid-call authorization and human
|
|
Persian listening. Cold-start behavior under target deployment resources remains
|
|
an explicit qualification, not a passed reliability/performance check.
|