← Back to Pull requests

vela: add the 0.8B native bundle export, wire contract and token-level processing #175

Open
unknown opened this pull request with 490 lines diff across 6 files
View on GitHub
unknown unknown commented on Oct 25, 2026 06:02 UTC
Author

Stacked on #151 + #174 — incremental review. Current head b437e3c9, rebased onto main at 285c791; the latest commits are the review fixes listed under Test Result.

Required human contributor answers

1. What outcome are you trying to achieve?

Start the native Rust path for the 0.8B: export the checkpoint into a verifiable bundle, implement the wire admission, and mirror the token-level processing — checked against frozen token-plan fixtures recorded from the pinned runtime. (Source: issue #137.)

2. What is the highest-leverage variable?

Exact token-level parity with the pinned runtime is the foundation every later stage validates against.

3. How will this work move that variable?

Five frozen fixtures (including a windowed long-span and a CJK case) lock the predict mapping and rendered rows field-for-field; the opt-in render test replays them through the Rust code.

4. Who is the customer or user?

Contributors building the native worker; ultimately users needing GPU-accelerated Vela decisions.

Is a PR needed? Yes — prerequisite for the executor PR.

For a bug fix: N/A.

Purpose

Export script (export_native.py: gate-verified, per-tensor dtypes preserved, manifest SHA-256), Rust bundle gate + wire admission (byte-equal 422/400), token-level processing (state/questions/words/render/processing), five frozen token-plan fixtures, parity example binary.

Test Plan

System1-Omni Version / Commit: model/vela2-native-processing @ b437e3c9

| Check | Command | Result |
|---|---|---|
| CPU tests | cargo test -p omni-vela-native | 40 passed; 2 ignored |
| clippy | cargo clippy -p omni-vela-native --all-targets -- -D warnings | clean |
| Docs | mkdocs build --strict | exit 0 |
| Opt-in render parity | VELA_NATIVE_BUNDLE=… VELA_NATIVE_MANIFEST_SHA256=… cargo test --test vela_native_processing -- --ignored | 5/5 field-for-field |

Test Result

All passed. Render parity is opt-in (needs the exported bundle's tokenizer); CI covers CPU tests only.

  • Head b437e3c9 (rebased onto main at 285c791): every check in the table rerun and green — cargo test -p omni-vela-native --locked (40 passed, 2 opt-in ignored), the opt-in render parity against the local 0.8B export (the five token plans field-for-field, plus the structured-state tokenization), PYTHONPATH=src pytest tests/vela (138 passed), cargo fmt --all --check, crate clippy -D warnings and strict mkdocs build; CI and Docs workflows green.

  • What the latest commits change: cdff2999 keeps oversized integers exact in the native request path, with regressions above u64::MAX; 148f49dd sets VELA_NATIVE_MANIFEST_SHA256 in the field-level parity command; 8a650964 carries the executor slice's bundle-directory walk verbatim (a directory holding pinned paths is admitted and walked one level, unreadable entries are gate errors instead of panics, a symlinked entry is refused) with three walk regressions; b437e3c9 moves the state canonicalization tests under tests/vela with #[path] wiring, so no test body is left under src/.

  • Earlier head 9576f78d: every check in the table plus PYTHONPATH=src pytest tests/vela (137 passed), cargo fmt --all --check and strict mkdocs rerun and green at that head.
  • Demo / evidence

    Author-run, x86 WSL2, CPU FP32:

  • Opt-in render parity: all five token plans reproduce field-for-field (92s), including CJK and the windowed long-span (7,713 tokens).

  • example-request totals 1,041 tokens matching the oracle's usage.input_tokens.

  • Manifest file digests cross-checked against the package's own SHA256SUMS.

  • All test bodies at repository root; private-item tests use #[path] wiring.
  • Not measured: GPU, performance.

    Self-review

  • Full diff reviewed.

  • Architecture and scope checked.

  • Checks run and reported above.

  • Description and claims match implementation.
  • Diff: 490 lines (+367 / -123) across 6 files Reviewer: Levius-Fubuki Review duration: 53298m
    All Vouch review confidence checks passed
    Residual risk 0.45 = Change Risk (0.78) × (1 − Review Confidence (0.42)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.78 · 490 lines diff across 6 files
    0.78
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.371
    Shallow Review Depth shallow_review_depth
    0.344
    Sensitive Paths sensitive_paths
    0.078
    Real PR Conversation Timeline
    1 comments
    "Review active on #175"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 42.2% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 77.6% (HIGH) · Higher = larger blast radius
    77.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 42.2% · Lower = rushed or shallow review
    42.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 44.8% · Moderate risk
    44.8%