Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
06d1380
specs: plan the configurable base model (RFC phases 2-5)
Oct 19, 2026
33ecadc
modernbert: add the encoder family structure crate
Oct 19, 2026
1d2d956
laya: split the execution plan into a pure builder
Oct 19, 2026
0e6eaea
laya: run the encoder on the modernbert family core
Oct 19, 2026
48863a4
qwen3_5: split structure parsing from the ABI-6 capability gate
Oct 19, 2026
0397892
vela: add the 2.0 0.3B ModernBERT profile crate
Oct 19, 2026
d27fa12
cuda: add the 768-hidden ModernBERT profile to the laya bundle, ABI 2
Oct 20, 2026
d57cbe5
vela: execute the 0.3B encoder on the regenerated bundle
Oct 20, 2026
b08c136
specs: drop the local model-config planning series
Oct 20, 2026
889958b
vela: freeze oracle fixtures and compare endpoints with the reference
Oct 20, 2026
f598f17
modernbert: own the bundle dialects in the model crates
Oct 20, 2026
3426893
qwen3_5: assert the structure ABI matches the loaded library
Oct 20, 2026
93624ff
vela: rustfmt the executor buffer writes
Oct 20, 2026
e8b058a
vela: refuse every importable suffix in package verification
Oct 20, 2026
7227fc8
vela: validate token ids before the embedding launch
Oct 20, 2026
f828d17
modernbert: reject a zero global attention interval
Oct 20, 2026
f013512
vela: reconcile the worker with the #151 review head
Oct 20, 2026
6bfbd71
modernbert: fall back to the generic rope_theta key
Oct 20, 2026
dcc6dac
vela: refuse the type scratch slot instead of aliasing the ids buffer
Oct 20, 2026
5745213
Merge upstream/main into model/configurable-base-model
Oct 22, 2026
80a30e1
Merge upstream/main into model/configurable-base-model
Oct 22, 2026
28187c8
vela: refuse existing bytecode caches at the package gate
Oct 23, 2026
8d7be88
vela: keep bytecode writing off for the recipe's runtime imports
Oct 24, 2026
0139cb1
Merge upstream/main into model/configurable-base-model
Oct 25, 2026
b023c7f
Merge upstream/main into model/configurable-base-model
Oct 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[workspace]
members = ["src/frontend", "src/runtime", "src/models/clm", "src/models/cua_s1/native", "src/models/qwen3_5/native", "src/models/open_jev/native", "src/models/jev_vl/native", "src/models/omnijev/native", "src/models/laya", "src/backends/cuda", "src/models/decider/native", "src/models/jemm/native", "src/models/startlux/native"]
members = ["src/frontend", "src/runtime", "src/models/clm", "src/models/cua_s1/native", "src/models/qwen3_5/native", "src/models/open_jev/native", "src/models/jev_vl/native", "src/models/omnijev/native", "src/models/laya", "src/models/modernbert", "src/models/vela/native", "src/backends/cuda", "src/models/decider/native", "src/models/jemm/native", "src/models/startlux/native"]
resolver = "3"
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ repository root.
| [`docs/`](docs/) | Project documentation and architecture assets. |

The frontend, native runtime, the native workers, their shared Qwen3.5/3.8
prefill implementation and the Laya CUDA backend are Cargo workspace members.
prefill implementation, the ModernBERT family structure crate, the Vela native
profile crate and the Laya CUDA backend are Cargo workspace members.
Each model and backend documents its implementation and process boundary.

## Getting Started
Expand Down
92 changes: 83 additions & 9 deletions recipe/vela/compare_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@
finishing).

Both paths execute the same verified runtime, and the worker delegates
response construction to the same pinned code — so the criterion is the
charter's reference parity: exact match, including JSON key order, with
response construction to the same pinned code — so the criterion is
reference parity: exact match, including JSON key order, with
rejections agreeing on status and body (``{"detail": [{"loc", "msg",
"type"}]}``). ``--export`` additionally freezes the oracle fixture —
request, SystemOne response and the predict()-level answers — for the
future native encoder slices, and writes it only after a passing,
non-rejected comparison. Requires the pinned package, the reference
dependencies, and fastapi+uvicorn+httpx; see recipe/vela/reference.md.
"type"}]}``). The run also compares the worker's verbatim endpoint
bodies (``/health``, ``/ready``, ``/v1/models`` and the unauthorized
401) against the live reference app. ``--export`` additionally freezes
the oracle fixture — request, SystemOne response, the predict()-level
answers and the generating run's provenance — for the future native
encoder slices, and writes it only after a passing, non-rejected
comparison. Requires the pinned package, the reference dependencies,
and fastapi+uvicorn+httpx; see recipe/vela/reference.md.

The default fixture set is the recipe's four example requests plus
five synthetic rejections: an invalid span question (whole-request
Expand Down Expand Up @@ -221,17 +224,56 @@ def compare_case(name, worker, reference):
return lines, False


def endpoint_parity(client, gated, worker_endpoints, unauthorized_body, probe_body):
"""Compare the worker's verbatim endpoint bodies with the live reference app.

``worker_endpoints`` maps the reference app's GET routes to the exact
bodies the worker serves; ``gated`` is a reference app built with an
API key, so an unauthorized POST must answer the worker's 401 body.
A drift in either direction fails the run. Returns report lines and
the failure count.
"""

lines = []
failures = 0
for path, expected in worker_endpoints:
response = client.get(path)
observed = response.json()
if response.status_code != 200 or observed != expected:
failures += 1
lines.append(
f"endpoint {path}: FAIL: HTTP {response.status_code} "
f"{json.dumps(observed, ensure_ascii=False)[:160]} != the worker's "
f"{json.dumps(expected, ensure_ascii=False)[:160]}"
)
else:
lines.append(f"endpoint {path}: HTTP 200, exact body match: PASS")
response = gated.post("/v1/systemone", json=probe_body)
observed = response.json()
if response.status_code != 401 or observed != unauthorized_body:
failures += 1
lines.append(
f"unauthorized POST: FAIL: HTTP {response.status_code} "
f"{json.dumps(observed, ensure_ascii=False)[:160]} != the worker's "
f"{json.dumps(unauthorized_body, ensure_ascii=False)[:160]}"
)
else:
lines.append("unauthorized POST: 401, exact body match: PASS")
return lines, failures


def export_allowed(ok, worker):
"""The oracle freezes served 200 responses, never a rejection."""

return ok and worker[0] == 200


def export_oracle(name, body, response, predict, path):
def export_oracle(name, body, response, predict, path, source):
"""Freeze one passing case for the future native encoder slices."""

oracle = {
"case": name,
"source": source,
"request": body,
"system_one": response,
"predict": predict,
Expand Down Expand Up @@ -260,12 +302,44 @@ def main(argv=None):
finally:
sys.dont_write_bytecode = previous_dont_write_bytecode

from frontend.vela import HEALTH_BODY, MODELS_ENTRY, READY_BODY, UNAUTHORIZED_BODY

app = vela2_serve.create_app(executor.engine, model_name=executor.model_name, api_key=None)
client = TestClient(app)
gated = TestClient(
vela2_serve.create_app(executor.engine, model_name=executor.model_name, api_key="parity-key")
)
source = {
"model": MODEL_NAME,
"device": args.device,
"generator": "recipe/vela/compare_reference.py --export",
}
# A well-formed probe body: any answer other than the worker's 401
# means the reference's key gate drifted, not the probe itself.
unauthorized_probe = {
"model": MODEL_NAME,
"state": "short",
"questions": {"q": {"type": "noul", "instructions": "any?"}},
}

exported = 0
failed = 0
try:
endpoint_lines, endpoint_failures = endpoint_parity(
client,
gated,
[
("/health", HEALTH_BODY),
("/ready", READY_BODY),
("/v1/models", {"models": [{**MODELS_ENTRY, "name": executor.model_name}]}),
],
UNAUTHORIZED_BODY,
unauthorized_probe,
)
print("endpoint parity:")
print("\n".join(endpoint_lines))
print()
failed += endpoint_failures
for name, body in load_cases(args.fixture):
raw = json.dumps(body).encode("utf-8")
worker = worker_response(raw, executor, decide)
Expand All @@ -279,7 +353,7 @@ def main(argv=None):
target = Path(args.export)
if target.is_dir():
target = target / f"oracle-{name}.json"
export_oracle(name, body, worker[1], executor.engine.predict(req), target)
export_oracle(name, body, worker[1], executor.engine.predict(req), target, source)
exported += 1
print()
finally:
Expand Down
16 changes: 10 additions & 6 deletions recipe/vela/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The slice is:

Out of scope for this slice: the hybrid members (0.8B/4B/9B — their
reference workers are a separate slice), the ONNX backend, any native
Rust/CUDA executor (the frozen RFC's ModernBERT-profile route), and
Rust/CUDA executor (a future ModernBERT-profile route), and
`noul_calibration` (a hybrid-only feature that does not exist on 0.3B).

## Architecture and ownership
Expand Down Expand Up @@ -229,13 +229,17 @@ invalid-span 422, an over-limit 413, and the missing-field /
extra-field / wrong-model envelope 422s) — through two paths that
share one loaded engine: the pinned
`vela2_serve.py` app via FastAPI's test client, and the production
`frontend.vela.decide` pipeline. The criterion is the charter's
reference parity: **exact match** including JSON key order for 200s,
`frontend.vela.decide` pipeline. The criterion is reference parity:
**exact match** including JSON key order for 200s,
and agreement on status and body for rejections (needs `pip install
fastapi uvicorn httpx` on top of the requirements file).
fastapi uvicorn httpx` on top of the requirements file). The run also
compares the worker's verbatim endpoint bodies — `/health`, `/ready`,
`/v1/models` and the unauthorized 401 — against the live reference app,
so a drift in either direction fails the run.
`--export tests/vela/fixtures/oracle-<case>.json` freezes each passing
200 case — request, SystemOne response and predict()-level answers — as
the frozen comparison baseline for the frozen RFC's native encoder
200 case — request, SystemOne response, predict()-level answers and the
generating run's provenance — as
the frozen comparison baseline for the future native encoder
slices, and writes it only after a passing comparison.

~~~sh
Expand Down
72 changes: 64 additions & 8 deletions recipe/vela/test_compare_reference.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env python3
"""Regression tests for recipe/vela/compare_reference.py.

Checks the pure comparison, case-loading and export helpers without the
pinned package, weights, torch or fastapi: exact-match verdicts
including key order, rejection agreement, the default fixture set's
shape (the invalid-span 422 and over-limit 413 synthetic cases), the
oracle export gate, and the oracle export structure.
Checks the pure comparison, case-loading, endpoint-parity and export
helpers without the pinned package, weights, torch or fastapi:
exact-match verdicts including key order, rejection agreement, the
default fixture set's shape (the invalid-span 422 and over-limit 413
synthetic cases), the oracle export gate, and the oracle export
structure.

python recipe/vela/test_compare_reference.py
"""
Expand Down Expand Up @@ -86,7 +87,7 @@ def check(name: str, condition: bool, detail: str = "") -> None:
lines, ok = tool.compare_case("fixture", (200, response()), (422, rejection))
check("worker answering a rejected request fails", not ok, "\n".join(lines))

# 3. The default case set carries the charter's fixture list shape.
# 3. The default case set carries the documented fixture list shape.
cases = tool.default_cases()
names = [name for name, _ in cases]
check(
Expand Down Expand Up @@ -139,18 +140,73 @@ def check(name: str, condition: bool, detail: str = "") -> None:
json.dumps(over)[:120],
)

# 4. The oracle export freezes the full native-comparison surface.
# 4. Endpoint parity fails only on a real body or status drift.
class FakeResponse:
def __init__(self, status_code, body):
self.status_code = status_code
self._body = body

def json(self):
return self._body

class FakeClient:
def __init__(self, gets, post=None):
self._gets = gets
self._post = post

def get(self, path):
return self._gets[path]

def post(self, path, json=None):
return self._post

health = {"status": "ok"}
models = {"models": [{"name": tool.MODEL_NAME}]}
endpoints = [("/health", health), ("/v1/models", models)]
unauthorized = {"detail": "Missing or invalid API key"}
probe = {"model": tool.MODEL_NAME, "state": "s", "questions": {}}

same = FakeClient(
{"/health": FakeResponse(200, dict(health)), "/v1/models": FakeResponse(200, {"models": [{"name": tool.MODEL_NAME}]})},
post=FakeResponse(401, dict(unauthorized)),
)
lines, failures = tool.endpoint_parity(same, same, endpoints, unauthorized, probe)
check(
"endpoint parity passes on exact bodies",
failures == 0 and lines[0].endswith("PASS") and lines[1].endswith("PASS")
and lines[2].endswith("PASS"),
"\n".join(lines),
)

drifted = FakeClient(
{"/health": FakeResponse(200, {"status": "degraded"}), "/v1/models": FakeResponse(200, {"models": [{"name": "other"}]})},
post=FakeResponse(401, {"detail": "different"}),
)
lines, failures = tool.endpoint_parity(drifted, drifted, endpoints, unauthorized, probe)
check("endpoint body drift fails", failures == 3, "\n".join(lines))

wrong_status = FakeClient(
{"/health": FakeResponse(503, dict(health)), "/v1/models": FakeResponse(200, {"models": [{"name": tool.MODEL_NAME}]})},
post=FakeResponse(401, dict(unauthorized)),
)
lines, failures = tool.endpoint_parity(wrong_status, wrong_status, endpoints, unauthorized, probe)
check("endpoint status drift fails", failures == 1, "\n".join(lines))

# 5. The oracle export freezes the full native-comparison surface.
body = {"model": tool.MODEL_NAME, "state": "s",
"questions": {"q": {"type": "noul", "instructions": "x"}}}
source = {"model": tool.MODEL_NAME, "device": "cpu",
"generator": "recipe/vela/compare_reference.py --export"}
with tempfile.TemporaryDirectory() as directory:
path = Path(directory) / "oracle.json"
oracle = tool.export_oracle(
"case", body, response(), {"answers": [{"id": "q", "type": "choice"}]}, path
"case", body, response(), {"answers": [{"id": "q", "type": "choice"}]}, path, source
)
reread = json.loads(path.read_text(encoding="utf-8"))
check(
"oracle export round-trips",
oracle == reread
and oracle["source"] == source
and oracle["request"] == body
and oracle["system_one"]["answers"]["q"]["noul"] == 0.75
and oracle["predict"]["answers"][0]["id"] == "q",
Expand Down
Loading
Loading