Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2608c79
feat(compute): VRAM budget types with CPU f64 fallback
seonghobae Aug 13, 2026
cbb0610
test(compute): require executable OOM retry plans
seonghobae Aug 14, 2026
3756821
fix(compute): emit executable OOM retry plans
seonghobae Aug 14, 2026
2a02408
ci(compute): verify executable OOM recovery plans
seonghobae Aug 14, 2026
016c6d7
ci(compute): activate PR 51 repair through registered workflow
seonghobae Aug 14, 2026
72f5302
ci(compute): preserve protected-main shared files during repair
seonghobae Aug 14, 2026
c197ed8
merge(main): reconcile compute-backend VRAM contracts
seonghobae Aug 14, 2026
5cfc349
fix(compute): register compute backend workspace package
seonghobae Aug 15, 2026
a28a52c
ci: expose exact missing compute coverage lines
seonghobae Aug 15, 2026
fc2abd5
test(compute): cover OOM retry peak overflow
seonghobae Aug 15, 2026
8f34bfd
ci: close PR 51 retry overflow coverage
seonghobae Aug 15, 2026
1029eba
fix(compute): emit executable OOM retry plans
github-actions[bot] Aug 15, 2026
b153334
Merge remote-tracking branch 'origin/main' into HEAD
seonghobae Aug 19, 2026
4d18290
fix(compute): close review gaps in OOM recovery
seonghobae Aug 19, 2026
8404b72
test(compute): prove streamed plans ignore corpus cardinality
seonghobae Aug 19, 2026
67aea63
fix(ci): remove obsolete PR 51 repair job
seonghobae Aug 19, 2026
0111a1a
fix(compute): harden parity and workload policy contracts
seonghobae Aug 20, 2026
0ac8055
test(compute): document cpu fallback batch semantics
seonghobae Aug 20, 2026
240979b
fix(compute): reject overflowing parity gaps
seonghobae Aug 20, 2026
e8a0ee3
Merge current main into compute backend gate
seonghobae Aug 21, 2026
1801501
ci(docs): run validation when pull requests open
seonghobae Aug 21, 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
173 changes: 173 additions & 0 deletions .github/workflows/docs-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@ name: Documentation Quality

on:
pull_request:
types:
- synchronize
- reopened
- ready_for_review
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
paths:
- "**/*.md"
- "**/*.json"
- ".github/workflows/**"
- "scripts/validate_documentation.py"
- "scripts/repair_pr51_*.py"
- "crates/compute_backend/**"
push:
branches:
- main
Expand Down Expand Up @@ -38,3 +44,170 @@ jobs:
run: python3 scripts/validate_documentation.py
- name: Reject whitespace errors
run: git diff --check HEAD^ HEAD || git diff --check

repair-pr51:
name: Repair executable OOM retry plans
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.number == 51 &&
github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.head.ref == 'agent/compute-backend-vram-budget'
runs-on: ubuntu-latest
timeout-minutes: 50
permissions:
contents: write
steps:
- name: Checkout exact PR branch
uses: actions/checkout@631c942040754b6e095e929c1677c07e10ed4f87
with:
ref: agent/compute-backend-vram-budget
fetch-depth: 0
persist-credentials: true
Comment thread
seonghobae marked this conversation as resolved.
Outdated
- name: Merge current protected main
run: |
git fetch origin main
git merge --no-edit origin/main
- name: Restore shared files from protected main
run: |
git checkout origin/main -- \
ARCHITECTURE.md \
CHANGELOG.md \
Cargo.lock \
Cargo.toml \
DOCUMENTATION.md \
README.md \
docs/TRACEABILITY.md \
docs/adr/README.md \
docs/research/standards-and-literature.md \
docs/validation/temporal-event-foundation.md \
scripts/check_workspace_contract.py \
tests/quality/test_check_docstrings.py
- name: Install pinned Rust toolchains
run: |
rustup toolchain install 1.97.1 --profile minimal --component clippy --component rustfmt --component llvm-tools-preview
rustup toolchain install nightly-2026-08-01 --profile minimal --component llvm-tools-preview
- name: Add recovery and numerical regressions
run: python3 scripts/repair_pr51_add_recovery_tests.py
- name: Prove old recovery contract is RED
run: |
set +e
output=$(cargo +1.97.1 test -p compute_backend --test vram_budget_contract 2>&1)
status=$?
set -e
printf '%s\n' "$output"
if [ "$status" -eq 0 ]; then
echo "Expected no-op OOM retry and tolerance contracts to fail before repair" >&2
exit 1
fi
grep -E "oom_retry_count|InvalidTolerance|recover_from_oom" <<<"$output"
- name: Apply executable recovery and reference repair
run: |
python3 scripts/repair_pr51_apply_recovery.py
cargo +1.97.1 fmt --all
- name: Reapply compute traceability to protected-main documents
run: |
python3 - <<'PY'
from pathlib import Path

readme_path = Path('README.md')
readme = readme_path.read_text(encoding='utf-8')
old_state = (
'This branch establishes the Task 1 Rust workspace and quality-gate foundation.\n'
'The ten bounded crates compile independently but intentionally expose no\n'
'placeholder production APIs. Domain behavior begins in Task 2 with immutable\n'
'evidence identifiers and source records.\n'
)
new_state = (
'The bounded crates compile independently and expose only validated production APIs.\n'
'`compute_backend` adds the first executable ADR 0006 slice: compensated CPU `f64`\n'
'reference arithmetic plus VRAM-budgeted planning and bounded OOM recovery; live GPU\n'
'kernels and hardware parity remain accepted targets.\n'
)
if readme.count(old_state) != 1:
raise SystemExit('README implementation-state target mismatch')
readme = readme.replace(old_state, new_state, 1)
crate_marker = 'crates/tepp_api\n'
if readme.count(crate_marker) != 1:
raise SystemExit('README crate list target mismatch')
readme = readme.replace(crate_marker, crate_marker + 'crates/compute_backend\n', 1)
readme_path.write_text(readme, encoding='utf-8')

trace_path = Path('docs/TRACEABILITY.md')
trace = trace_path.read_text(encoding='utf-8')
trace_old = '| CPU bounded multithreading + GPU/VRAM streaming/parity | ADR 0001/0006 | future `compute_backend` | accepted-target |'
trace_new = '| CPU bounded multithreading + GPU/VRAM streaming/parity | ADR 0001/0006 | `compute_backend` VRAM profiles, peak/autotune, executable bounded OOM retry plans, compensated CPU `f64` reference, and fail-closed estimand-preserving policies on the active PR; fixed-pool multithreading, live GPU kernels, mixed-precision device lanes, and hardware parity remaining | partial |'
if trace.count(trace_old) != 1:
raise SystemExit('TRACEABILITY compute target mismatch')
trace_path.write_text(trace.replace(trace_old, trace_new, 1), encoding='utf-8')

adr_index_path = Path('docs/adr/README.md')
adr_index = adr_index_path.read_text(encoding='utf-8')
adr_old = '| [0006](0006-vram-gpu-nvidia-orchestration.md) | VRAM-adaptive GPU compute and model-credential boundary | Accepted | accepted-target | LLM orchestration policy superseded by ADR 0010; autonomous development authority governed by ADR 0015. |'
adr_new = '| [0006](0006-vram-gpu-nvidia-orchestration.md) | VRAM-adaptive GPU compute and model-credential boundary | Accepted | partial | VRAM budgets, executable OOM retries, and compensated CPU `f64` reference are on the active PR; fixed-pool CPU multithreading, live GPU kernels, mixed-precision device lanes, and hardware parity remain accepted-target. |'
if adr_index.count(adr_old) != 1:
raise SystemExit('ADR index compute target mismatch')
adr_index_path.write_text(adr_index.replace(adr_old, adr_new, 1), encoding='utf-8')

standards_path = Path('docs/research/standards-and-literature.md')
standards = standards_path.read_text(encoding='utf-8')
section = '''## Numerical backends, VRAM, and mixed precision

IEEE. (2019). *IEEE standard for floating-point arithmetic* (IEEE Std 754-2019). https://doi.org/10.1109/IEEESTD.2019.8766229

Micikevicius, P., Narang, S., Alben, J., Diamos, G., Elsen, E., Garcia, D., Ginsburg, B., Houston, M., Kuchaiev, O., Venkatesh, G., & Wu, H. (2018). Mixed precision training. In *International Conference on Learning Representations*. https://openreview.net/forum?id=r1gs9JgRZ

NVIDIA Corporation. (2024). *CUDA C++ programming guide*. https://docs.nvidia.com/cuda/cuda-c-programming-guide/

Ogita, T., Rump, S. M., & Oishi, S. (2005). Accurate sum and dot product. *SIAM Journal on Scientific Computing, 26*(6), 1955–1988. https://doi.org/10.1137/030601818

Rhu, M., Gimelshein, N., Clemons, J., Zulfiqar, A., & Keckler, S. W. (2016). vDNN: Virtualized deep neural networks for scalable, memory-efficient neural network design. In *2016 49th Annual IEEE/ACM International Symposium on Microarchitecture (MICRO)* (pp. 1–13). IEEE. https://doi.org/10.1109/MICRO.2016.7783721

TEPP keeps IEEE 754 binary64 as the numerical reference and uses compensated deterministic summation for the sequential oracle. GPU work is streamed under a VRAM budget with reserved safety headroom, executable bounded OOM retries, and CPU fallback. Mixed precision is not permitted for final diagnostic quantities. Full-corpus document-by-topic tensors are refused on device memory. Hardware acceleration is not claimed from software-fallback tests.

'''
Comment thread
seonghobae marked this conversation as resolved.
Outdated
marker = '## AI risk, management systems, and assurance readiness\n'
if section not in standards:
if standards.count(marker) != 1:
raise SystemExit('standards numerical-section marker mismatch')
standards = standards.replace(marker, section + marker, 1)
standards_path.write_text(standards, encoding='utf-8')

validation_path = Path('docs/validation/temporal-event-foundation.md')
validation = validation_path.read_text(encoding='utf-8')
validation_row = '| VRAM budget + CPU fallback | `compute_backend` | active-PR | profile/autotune + executable OOM retries | compensated weighted-sum recovery; no live GPU claim | ADR 0006; `docs/research/vram-budget-types.md` |\n'
if validation_row not in validation:
marker = '| Versioned API/export contracts | `tepp_api` | implemented-main | naruon HTTP interchange | unknown-field/version/limit + naruon HTTPS interchange tests | Task 12 / PR #21; live HTTP service remaining |\n'
if validation.count(marker) != 1:
raise SystemExit('validation compute-row marker mismatch')
validation = validation.replace(marker, marker + validation_row, 1)
validation_path.write_text(validation, encoding='utf-8')
PY
- name: Verify focused, workspace, and documentation contracts
run: |
cargo +1.97.1 fmt --all --check
cargo +1.97.1 test -p compute_backend --all-features
cargo +1.97.1 clippy -p compute_backend --all-targets --all-features -- -D warnings
cargo +1.97.1 test --workspace --all-features
python3 scripts/check_workspace_contract.py
python3 scripts/check_docstrings.py
python3 scripts/validate_documentation.py
python3 -m unittest discover -s tests/quality -p 'test_*.py'
- name: Enforce exact authored coverage
run: |
cargo +1.97.1 install cargo-llvm-cov --locked --version 0.8.6
cargo +1.97.1 llvm-cov -p compute_backend --all-features --fail-under-lines 100
cargo +nightly-2026-08-01 llvm-cov --branch -p compute_backend --all-features --json --summary-only --output-path coverage-branches.json
python3 scripts/check_coverage.py coverage-branches.json --kind branches
- name: Commit verified repair and remove one-shot files
run: |
git checkout origin/main -- .github/workflows/docs-quality.yml
rm -f coverage-branches.json
rm -f .github/workflows/repair-pr51-executable-oom-retries.yml
rm -f scripts/repair_pr51_add_recovery_tests.py
rm -f scripts/repair_pr51_apply_recovery.py
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git diff --cached --check
git commit -m "fix(compute): emit executable OOM retry plans"
git push origin HEAD:agent/compute-backend-vram-budget
95 changes: 95 additions & 0 deletions .github/workflows/repair-pr51-executable-oom-retries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Repair PR 51 executable OOM retries

on:
pull_request:
types:
- synchronize
- reopened
- ready_for_review

permissions:
contents: read

concurrency:
group: repair-tepp-pr-51-executable-oom-retries
cancel-in-progress: true

jobs:
repair:
if: >-
github.event.pull_request.number == 51 &&
github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.head.ref == 'agent/compute-backend-vram-budget'
runs-on: ubuntu-latest
timeout-minutes: 45
permissions:
contents: write
steps:
- name: Checkout exact PR branch
uses: actions/checkout@631c942040754b6e095e929c1677c07e10ed4f87
with:
ref: agent/compute-backend-vram-budget
fetch-depth: 0
persist-credentials: true

- name: Merge current protected main
run: |
git fetch origin main
git merge --no-edit -X theirs origin/main

- name: Install pinned Rust toolchains
run: |
rustup toolchain install 1.97.1 --profile minimal --component clippy --component rustfmt --component llvm-tools-preview
rustup toolchain install nightly-2026-08-01 --profile minimal --component llvm-tools-preview

- name: Add recovery and numerical regressions
run: python3 scripts/repair_pr51_add_recovery_tests.py

- name: Prove old recovery contract is RED
run: |
set +e
output=$(cargo +1.97.1 test -p compute_backend --test vram_budget_contract 2>&1)
status=$?
set -e
printf '%s\n' "$output"
if [ "$status" -eq 0 ]; then
echo "Expected no-op OOM retry and tolerance contracts to fail before repair" >&2
exit 1
fi
grep -E "oom_retry_count|InvalidTolerance|recover_from_oom" <<<"$output"

- name: Apply executable recovery and reference repair
run: |
python3 scripts/repair_pr51_apply_recovery.py
cargo +1.97.1 fmt --all

- name: Verify focused, workspace, and documentation contracts
run: |
cargo +1.97.1 fmt --all --check
cargo +1.97.1 test -p compute_backend --all-features
cargo +1.97.1 clippy -p compute_backend --all-targets --all-features -- -D warnings
cargo +1.97.1 test --workspace --all-features
python3 scripts/check_workspace_contract.py
python3 scripts/check_docstrings.py
python3 scripts/validate_documentation.py
python3 -m unittest discover -s tests/quality -p 'test_*.py'

- name: Enforce exact authored coverage
run: |
cargo +1.97.1 install cargo-llvm-cov --locked --version 0.8.6
cargo +1.97.1 llvm-cov -p compute_backend --all-features --fail-under-lines 100
cargo +nightly-2026-08-01 llvm-cov --branch -p compute_backend --all-features --json --summary-only --output-path coverage-branches.json
python3 scripts/check_coverage.py coverage-branches.json --kind branches

- name: Commit verified repair and remove one-shot files
run: |
rm -f coverage-branches.json
rm -f .github/workflows/repair-pr51-executable-oom-retries.yml
rm -f scripts/repair_pr51_add_recovery_tests.py
rm -f scripts/repair_pr51_apply_recovery.py
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git diff --cached --check
git commit -m "fix(compute): emit executable OOM retry plans"
git push origin HEAD:agent/compute-backend-vram-budget
19 changes: 19 additions & 0 deletions crates/compute_backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "compute_backend"
description = "VRAM-budgeted GPU planning with a CPU f64 reference and fail-closed OOM fallback."
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
readme.workspace = true
keywords.workspace = true
categories.workspace = true
publish = false

[dependencies]

[lints]
workspace = true
Loading
Loading