Skip to content

Preregister latest-local-model qualification on the RTX 4090 (8-K item extraction; Qwen3.8 + past-weeks releases) - #323

Merged
seathatflowsinourveins merged 5 commits into
mainfrom
claude/local-inference-latest-prereg-20260926
Sep 26, 2026
Merged

seathatflowsinourveins merged 5 commits into
mainfrom
claude/local-inference-latest-prereg-20260926

Conversation

@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator

Scope

  • Lane: lane:foundation. This is the workstation's model-qualification role, and it serves the north-star research input: catalyst extraction from 8-K filings.
  • What: a frozen preregistration only. No model download, no SEC fetch and no GPU run happens in this PR. The GPU windows start after it merges.
  • User decision (2026-09-26): GPU windows are approved, and only the latest SOTA models are in scope: the Qwen3.8 family and releases from the past weeks.

The protocol (blueprints/convergence-practice/local-inference-latest-20260926/)

Task. 8-K item extraction on the frozen 2020-03-02 daily-index cohort (the same cohort as blueprints/us-equities/catalyst-dataset).

  • Filings are re-acquired from EDGAR through the catalyst-provenance EdgarTools SDK. The SEC contact is passed by pointer, fetching stays at no more than 5 requests/s, and the content is kept private.
  • Labels are the filings' native header ITEMS. The model input has the SEC header stripped, so the model never sees the answer.

Metrics. Micro-F1 per filing, macro-F1 per item code, exact match, and JSON-valid rate; decode tokens/s, TTFT, peak device memory and failures.

Decision rule. An arm replaces the current production model (C0) only if all of these hold:

  1. the paired-bootstrap lower bound (10,000 resamples, seed 20260926) of the F1 difference versus C0 is at least −0.02;
  2. its median decode speed is higher than C0's;
  3. its JSON-valid rate is at least 0.98;
  4. it had no memory, deadline or server failure.

Speed alone does not pass.

GPU window safety.

  • window.sh stops only nativestack-generation and always restarts it.
  • Admission and reserve limits apply, with bounded monitors and an independent window deadline.
  • Each arm runs on a test port under systemd-run memory limits.

Arms, pinned by Hugging Face revision and GGUF sha256:

Arm Model Status
C0 production Qwen3.8-27B UD-Q4_K_M, b11146, 36 layers runnable
C1 fuller GPU offload runnable if memory admits it
C2 C1 + official MTP draft (--spec-type draft-mtp) runnable if memory admits it
M MiMo-V2.6-Distill-Qwen-9B Q8_0 (ggml-org, MIT) runnable
B Ternary-Bonsai-2-27B PTQ1_0 runtime_unsupported: stock ggml has no PTQ1_0/PQ2_0 type (PrismML fork needed)
X Xing4.0-29B-A4B IQ4_NL runtime_unsupported: xing4_0 architecture absent in b11146
— Qwen3.8-Flash-Next resource_infeasible: at least 93.7 GB against about 77 GB of available RAM

The literal full-GPU and MTP profiles are recorded as resource_infeasible_on_host, with the arithmetic.

SOTA sources

  • llama.cpp b11146 (7fe450e, = v0.5.0): https://github.com/ggml-org/llama.cpp/releases/tag/v0.5.0. --spec-type draft-mtp is in the local --help, and the ggml type table and src/llama-arch.cpp were read at 7fe450e.
  • Hugging Face model cards and blobs APIs, read 2026-09-26:
    • unsloth/Qwen3.8-27B-GGUF @4ca72078
    • ggml-org/MiMo-V2.6-Distill-Qwen-9B-GGUF @81baddc3
    • prism-ml/Ternary-Bonsai-2-27B-gguf @b072e1d3
    • XingChen-AGI/Xing4.0-29B-A4B-GGUF @b8cd0a75
    • unsloth/Qwen3.8-Flash-Next-GGUF @38bb39ee
  • EdgarTools 5.58.0: FilingHeader.parse_from_sgml_text, used as the label path (see the catalyst-dataset README).
  • Pattern reused: blueprints/convergence-practice/gpu-inference/plan.json, with the same admission and reserve limits, frozen sampling and failure rule.

Evidence-class table

Claim Class
Pins, file sha256 and sizes source_review (HF API) plus a read-only local sha256 of C0
Runtime support for B and X source_review of ggml/llama.cpp at 7fe450e; not loaded
Protocol logic synthetic: 44 unit tests, including real EdgarTools label parsing on synthetic headers and whole-window runs against fake systemctl, nvidia-smi and llama-server
Model quality and speed not measured yet; that is the next PR

Commands

uv run --no-project --with jsonschema --with pyyaml python -m unittest tests.test_local_inference_latest_20260926 -v   # 44 OK
uv run --no-project --with jsonschema --with pyyaml python -m unittest    # full suite 5809 OK (writer run)
python3 scripts/validate_convergence.py --all-recorded --root . --json    # valid, 23 records (this one registered)
python3 scripts/validate.py                                              # passed
bash -n window.sh; shellcheck window.sh                                   # 0 findings

Review

  • Two-family review, then one repair round. The findings came from Claude Opus 5.5 at max and GPT-6-Astra at max; the GPT-6 review ran before the account usage limit.
  • Every high and medium finding was fixed:
    • the unit allow-list in window.sh;
    • bounded memory queries and cleanup, plus an independent window deadline;
    • server 5xx responses now disqualify an arm;
    • labels are read natively from the header before <FILER>;
    • the C1/C2 profiles were refit to host memory.
  • Low findings and the remaining residuals are listed in the experiment record.

🤖 Generated with Claude Code

Scout and others added 3 commits September 26, 2026 00:15
…frozen, not run)

Add blueprints/convergence-practice/local-inference-latest-20260926, a frozen
plan and a planned convergence record. They compare the production
Qwen3.8-27B UD-Q4_K_M endpoint (C0: llama.cpp b11146, 36 GPU layers, 8192
context) with the same model fully on the GPU (C1), C1 plus the official MTP
draft file (C2) and MiMo-V2.6-Distill-Qwen-9B Q8_0 (M). The task is the
frozen 2020-03-02 SEC 8-K cohort. Ternary Bonsai 2 27B PTQ1_0 (B) and
Xing4.0-29B-A4B (X) are recorded runtime_unsupported from b11146's pinned
type table and architecture list. Qwen3.8-Flash-Next is resource_infeasible
and is not an arm.

Each model file is pinned by repository, full revision, LFS SHA-256 and size,
read from the Hugging Face API on 2026-09-26. plan.json holds the SHA-256 of
every script and of the prompt. The change adds:
- acquire.py: EdgarTools 5.58.0, at most 5 requests/s, no retries, contact
  from the SEC_CONTACT_ENV pointer, SEC bytes kept private.
- eval_arm.py: one arm against a loopback server; public metrics carry no
  document text.
- analyze.py: paired bootstrap (10,000 resamples, seed 20260926) and the
  four-criterion replacement rule.
- window.sh: coordination gate, admission and a 3 GiB device-memory guard,
  a scoped MemoryMax, and an exit trap that restores the production unit.

Nothing was downloaded, run or fetched from SEC. The offline tests
(tests/test_local_inference_latest_20260926.py, 25 tests) use synthetic
fixtures only. The coordinator registers the files in manifests/evidence.json.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…round)

One bounded repair round on the frozen plan, still before any download,
SEC request or GPU window. Findings verified against source and host
evidence first:

- C0 budget: the production journal (118 requests, cut off 2026-09-26T03:30Z)
  shows 61.5-146.1 prompt and median 4.79 decode tokens/s, so ~350 filings
  need ~8,900 s (central) to ~15,500 s. Every arm now runs in resumable
  segments (at most one window each, at most four), continued automatically
  by window.sh from the first unattempted filing, with results carried
  verbatim and chained by SHA-256; request deadline 600 s (hang detector),
  arm budget 9,600 s; expected C0 duration predeclared.
- Labels: EdgarTools 5.58.0 parse_from_sgml_text raises AttributeError on
  headers with two or more FILER blocks (reproduced offline; 9 co-filing
  groups in the cohort). It now parses the header before the first entity
  block, cross-checked with collect_repeated_tags.
- Admission: at most 24,143 - 3,930 = 20,213 MiB can be free beside the
  embeddings service, so the tasked C1 (-ngl 99) and C2 (+ MTP draft file)
  are recorded resource_infeasible_on_host. C1 and C2 now keep every layer
  on the GPU with --n-cpu-ffn 20; C2 drafts from the main file's own MTP
  layer (b11146 --spec-type draft-mtp without a draft model). Windows-side
  app closure is a required pre-step; window.sh predicts admission before
  stopping production.
- window.sh accepts only nativestack-generation.service or none, bounds
  every nvidia-smi query and cleanup wait, and arms an independent
  transient restore timer before the production stop.
- Server errors other than a context overflow (HTTP 400
  exceed_context_size_error) stop the arm and fail criterion (4); b11146
  answers compute errors with HTTP 500 and keeps serving. Error bodies stay
  private.
- analyze.py reads every window under --state-dir and fails an arm on
  missing, malformed, gappy or non-covering memory samples, a sampled
  reserve breach, an unverified MemoryMax, re-runs or broken chains.

Tests: 44 synthetic tests, including whole windows against stand-ins (hung
nvidia-smi, SIGTERM, admission refusal, refusals before any stop) and the
real EdgarTools path on co-filed headers when the SDK is installed.
Reverting each fix makes its tests fail. All frozen hashes refrozen.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…cord (hot-file commit)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@seathatflowsinourveins seathatflowsinourveins added the lane:foundation Foundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers label Sep 26, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@seathatflowsinourveins
seathatflowsinourveins enabled auto-merge (squash) September 26, 2026 04:16
Scout and others added 2 commits September 26, 2026 00:48
…L clear-text alert)

CodeQL py/clear-text-storage-sensitive-data flagged the class attribute named SECRET
(a synthetic filing string). It is now FILING_MARKER; behaviour unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane:foundation Foundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants