feat(tot): Phase L-6 4-layer tests#96
Merged
Merged
Conversation
Add the 4-layer test suite for the tot orchestrator library, mirroring
the eqlib / trlib L-6 work. tot-specific twist: every parameter name
carries an <ns>: namespace prefix (eq:RR, tr:DT, fp:NSMAX, ...) because
the orchestrator parameter space is the union of the per-module
registries.
- python/totlib/tests/fixtures/{__init__,tot_demo2014_params,tot_ht6m_params}.py:
namespaced PARAMS replaying the standalone tot_demo2014_short and
tot_ht6m_short namelists through libtotapi.so (eq:RR=8.5/0.65,
tr:DT=0.0001, etc.).
- python/totlib/tests/test_equivalence.py (Layer 1): diff a Tot()
replay vs test_run/baselines/tot_*/metrics.json at tol=1e-10.
Triple-skip-gated on libtotapi.so, totlib importability, and
TOT_RUN_OK=1 (the L-3/L-4/L-5 stubs return TOT_ERR_NOT_IMPL).
- python/totlib/tests/test_sweep.py (Layer 4): 3x3 eq:RR x eq:BB
grid with a fresh `with Tot()` per sample (re-init fix from trlib
PR #83 / eqlib L-6); verifies nrmax / nsmax stay invariant across
cells. Same TOT_RUN_OK gating.
- tot/tests/c_abi/test_negative.c (Layer 2): pre-init NOT_IMPL
contract, unknown-namespace / missing-prefix / empty-prefix
rejection (TOT_ERR_INVALID), per-module unknown-bare reject for
every prefix, double-finalize safety, post-finalize dispatcher
invariance.
- tot/Makefile: new tot_api_check_all umbrella target wraps
tot_api_check + tot_api_check_so + test_negative for one-shot CI
invocation. Mirrors eq_api_check_all in eq/Makefile.
- test_run/test_definitions.conf: append five totlib_* rows
(c_abi / wrapper / ffi / equivalence / sweep) following the existing
per-module L-6 row shape.
Verification:
- python3 -m unittest discover python/totlib/tests -v -> 47 tests, 24
skipped (pass-or-skip clean; equivalence + sweep gated on so/RUN_OK).
- bash -n test_run/run_tests.sh -> rc=0.
- ./test_run/run_tests.sh -l | grep totlib_ -> 5 rows.
No edits to totlib core (totlib.py / state.py / _ffi.py / errors.py).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
Author
|
@cursor review |
k-yoshimi
added a commit
that referenced
this pull request
Apr 19, 2026
2026-04-19 改訂. tr/ti/wr/wrx/fp の 5 章はそのまま保持し, 新たに第 8 章 eq モジュール (6 関数 C ABI と PSIB 0-origin の 解説含む), 第 9 章 tot モジュール (名前空間プレフィックス設計) を追加. 完了モジュールを 5 → 7 に拡大. - 第 8 章 (eq): 概要, ビルド, hello-world, set_param_str (KNAMEQ), PSIB 0-origin / run() mode=1 デフォルトの FAQ, 約 60 件の パラメータ表, EqState フィールド, F90 modernization (F-1..F-5) への言及, 変更履歴 (PR #54/#65/#70/#78/#80/#86/#92/#89 と #71/#79/#81/#87/#93) - 第 9 章 (tot): 概要, ビルド, hello-world, namespace prefix ディスパッチ表, wr→wrx 別名, dict/set_param_str, 既知制約 (init/run/get_state/finalize は L-3/L-4/L-5 でスタブ), 変更履歴 (PR #43/#82/#85/#91/#94) - 状況章を更新: モジュール完了マトリクスを 7 行化, eq F90 modernization (F-1..F-5) 完了マトリクス追加, MCP サーバ群 (tr/ti/wr/wrx/fp + tot 進行中, 6 個) 追加 - 残作業: trlib のみ実装の plot/TOML runner 横展開 (deferred), チュートリアル Notebook 集 (deferred) - 付録 PR 一覧を 2026-04-19 (#96 まで) に最新化, eq/tot/MCP 追記 - 補足カタログに eq/tot の最短例 2 つを追加 - xelatex 2 回コンパイル成功, PDF 55 ページ (旧版から +拡張) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
Owner
Author
|
@cursor review |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
Author
|
@cursor review |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 76f040d. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase L-6 of the TOT module library work: 4-layer test suite mirroring eqlib / trlib L-6, adapted for the orchestrator (every parameter name carries an `:` namespace prefix because tot's parameter space is the union of eq / tr / fp / ti / wr / wrx).
No edits to totlib core (`totlib.py` / `state.py` / `_ffi.py` / `errors.py`).
Test plan
Note
Low Risk
Low risk: changes are limited to new test/fixture code and build/test harness wiring, with no modifications to totlib runtime logic. Main risk is CI/build breakage if the new
tot_api_check_alltarget orTOT_RUN_OK-gated tests are misconfigured.Overview
Adds Phase L-6 test coverage for the
totorchestrator mirroring the per-module L-6 shape: Layer 1 equivalence (test_equivalence.py) that replays namespaced fixtures throughTot()and diffsTotState.to_dict()againsttest_run/baselines/*/metrics.json, and Layer 4 sweep (test_sweep.py) that runs a 3x3eq:RR×eq:BBgrid with a freshTot()per cell to smoke-test lifecycle stability.Introduces namespaced parameter fixtures for
tot_demo2014_shortandtot_ht6m_shortundertotlib.tests.fixtures, plus a new Layer 2 C ABI negative driver (tot/tests/c_abi/test_negative.c) and a compositemake -C tot tot_api_check_alltarget to run smoke/param/run_so/negative. Wires the newtotlib_*jobs intotest_run/test_definitions.conf, with Layer 1/4 gated behindTOT_RUN_OK=1untiltot_run/tot_get_stateare implemented.Reviewed by Cursor Bugbot for commit 76f040d. Bugbot is set up for automated code reviews on this repo. Configure here.