Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
65 changes: 65 additions & 0 deletions .github/workflows/ci-self-hosted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CppMega MLX self-hosted CI

on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:

concurrency:
group: cppmega-mlx-ci-${{ github.ref }}
cancel-in-progress: true

jobs:
mac-contracts:
name: macOS MLX data, model, and eval contracts
runs-on: [self-hosted, macOS, ARM64, cppmega-mlx-macos]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Run focused MLX contract suite
shell: bash
run: |
set -euo pipefail
python_bin=/Volumes/external/sources/cppmega.mlx/.venv/bin/python
test -x "${python_bin}"
"${python_bin}" -m pytest -q \
tests/test_ast_fim.py \
tests/test_audit_sidecar_parquet.py \
tests/test_cpp_jsonl_generation_compile_eval.py \
tests/test_domain_graph_routes.py \
tests/test_eval_domain_routed_codegen.py \
tests/test_inference_generation.py \
tests/test_megatron_indexed.py \
tests/test_pack_enriched_rows.py \
tests/test_streaming_conveyor_progress.py \
tests/test_process_commits_fail_loud.py \
tests/test_repair_packed_document_boundaries.py
git diff --check

linux-portable:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +16 to +42
name: Linux portable syntax and conveyor contracts
runs-on: [self-hosted, Linux, X64, cppmega-mlx]
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install portable test dependencies
run: python -m pip install --disable-pip-version-check pytest numpy pyarrow tokenizers zstandard
- name: Run portable script contracts
shell: bash
run: |
set -euo pipefail
# cppmega.mlx imports Apple's MLX runtime at package import time. The
# Linux runner exercises only portable scripts and deliberately skips
# the macOS-only root conftest/package initialization.
python -m pytest -q --noconftest \
tests/test_audit_sidecar_parquet.py \
tests/test_streaming_conveyor_progress.py \
tests/test_process_commits_fail_loud.py \
tests/test_repair_packed_document_boundaries.py
python -m compileall -q scripts tools/clang_indexer
git diff --check

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +43 to +67
7 changes: 3 additions & 4 deletions .github/workflows/cuda-lane.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: CUDA Lane

on:
push:
branches: [main]
pull_request:
branches: [main]
# CUDA capacity is provisioned explicitly (for example on Nebius H200).
# Do not leave ordinary PRs queued forever when no self-hosted CUDA runner
# is attached to this repository.
workflow_dispatch:

jobs:
Expand Down
9 changes: 9 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,12 @@ See CLAUDE.md. This overrides every rule below.
format directly;
- only use casts/reshapes as explicit graph decisions, not hidden adapter
staging.

## Native subagents

- Use Codex native subagents for independent, bounded parallel work when it
materially improves throughput.
- Every native subagent must use `gpt-5.6-sol` with `ultra` or `max`
reasoning. Use `ultra` by default.
- Do not use another model or a lower reasoning level unless the user
explicitly overrides this rule.
10 changes: 5 additions & 5 deletions cppmega_mlx/data/ast_fim.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* 10% of the time we emit a random-CHAR-FIM example whose middle is a random
token span (``fim.sample_middle_span``) that may start/end mid-statement —
this teaches robustness to arbitrary cursor positions. The fall-back to the
char path is RECORDED in the returned ``AstFimResult.kind`` ("char_fim"),
never silent.
char path is RECORDED in the returned ``AstFimResult.kind`` ("char_fim"
or "char_ifim" for instruction-aware examples), never silent.

iFIM variant: when the document carries a leading comment / docstring we extract
it via ``fim.extract_ifim_instruction_text`` and emit through
Expand Down Expand Up @@ -58,7 +58,7 @@
# Fraction of AST-FIM examples; the remaining slice is random-char-FIM.
DEFAULT_AST_FIM_RATE = 0.9

AstFimKind = Literal["ast_fim", "char_fim", "ast_ifim"]
AstFimKind = Literal["ast_fim", "char_fim", "ast_ifim", "char_ifim"]


class NoEligibleChunkError(ValueError):
Expand Down Expand Up @@ -306,11 +306,11 @@ def apply_ast_ifim(
except NoEligibleChunkError:
start, end = sample_middle_span(length, rng=rand)
chunk_index = None
kind = "char_fim"
kind = "char_ifim"
else:
start, end = sample_middle_span(length, rng=rand)
chunk_index = None
kind = "char_fim"
kind = "char_ifim"

mode: FIMMode = "spm" if rand.random() < spm_rate else "psm"
permuted = apply_ifim_permutation(
Expand Down
Loading
Loading