memory-safety-and-progress
Preserve truthful experiment context with bounded memory, append-only history, safety signals, gates, and read-only progress inspection.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- memory-safety-and-progress
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Preserve truthful experiment context with bounded memory, append-only history, safety signals, gates, and read-only progress inspection.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/memory-ledger-journal.md6.6 KB
- 参考文档references/progress-export.md5.2 KB
- 参考文档references/safety-and-gates.md7.0 KB
- 参考文档references/troubleshooting.md6.0 KB
- 脚本scripts/inspect_progress_state.py13.2 KB
03 SKILL.md 正文
Memory, safety, and progress
Use this sub-skill when an experiment loop needs to remember what happened, avoid repeating dead ends, detect unsafe/stale progress, or report status. It is an operating guide for the project state contract; it is not the loop orchestration guide and it does not launch experiments, inspect GPUs, install skills, or mutate an Obsidian vault.
Operating rules
- Treat
PROJECT_BRIEF.mdas frozen Tier 1 context. Never rewrite it as a side effect of logging or compaction. - Use
workspace/MEMORY_LOG.mdfor bounded milestones and recent decisions. Use the ledger and journals for durable, append-only detail; do not pretend that a compacted memory log is the complete history. - Record every cycle outcome in
workspace/experiments.jsonlwhen the ledger is enabled. One JSON object per line is the recovery boundary. - Keep
DEAD_ENDS.mdandINSIGHTS.mdappend-only. Rotation moves the full old file to a uniquely named.bak; never delete an archive to make a rotation appear successful. - Interpret safety, stagnation, and phase-gate results as signals. They are advisory: stop, back off, change direction, or ask for a human decision; do not fabricate a result from a signal.
- A known failed terminal outcome stays failed everywhere. In particular,
Slurm
TIMEOUT,CANCELLED,OUT_OF_MEMORY,NODE_FAIL, and similar terminal states must remain failed in state, ledger, and dashboards. - For inspection, run the bundled read-only script. It reads a supplied project and emits checks; it never writes state, journals, exports, or archives.
First response to a progress request
- Read the brief, memory log, counter, state, ledger tail, journal tails, and cycle-time file if present.
- Report missing, malformed, stale, or unreadable files explicitly.
- Separate observed values (ledger/state) from derived values (best metric, stagnation, gate, rate-limit wait).
- If
state.status == "failed", show the terminal state and do not downgrade it tocompleted,idle, or “probably okay”. - If history is malformed, preserve the original bytes and use the valid records only; recovery is append-first, not rewrite-first.
Quick inspection
From this skill directory, use:
python scripts/inspect_progress_state.py --project <project>
Useful bounded variants are --format json, --ledger-tail 10,
--journal-tail 1200, --metric-key acc, --metric-direction higher_better,
--gate-threshold 0.8, --max-cycles-per-hour 6, and --now <unix-seconds>.
Add --workspace <relative-or-absolute-workspace> when the project does not
use the default workspace directory. The script only reads; it is safe for
triage and synthetic fixtures.
Choose the right state mechanism
| Need | Mechanism | Truth boundary |
|---|---|---|
| Frozen goal and constraints | PROJECT_BRIEF.md |
Human/project input |
| Small context for the next think step | MEMORY_LOG.md |
Bounded, lossy view |
| Every cycle and outcome | experiments.jsonl |
Append-only event history |
| “Do not retry this” | DEAD_ENDS.md |
Append-only, rotated |
| Durable observation | INSIGHTS.md |
Append-only, rotated |
| Current process/result snapshot | state.json |
Mutable current state |
| Restart-safe cycle number | .cycle_counter |
Plain integer |
| Anti-burn starts | .cycle_times |
JSON list of timestamps |
Read the linked references for exact constructors, fields, formulas, output formats, recovery actions, and failure handling:
Handoff boundaries
Route core THINK/EXECUTE/REFLECT orchestration to
autonomous-experiments. Route GPU discovery, utilization, and resource
reservation to gpu-and-resource-operations. Route source skill installation
or importing to skills-and-installation. This sub-skill may interpret their
reported state, but must not silently take over those responsibilities.
When a report is requested, include: project goal; cycle count; current state; latest valid ledger records; metric direction and best value; stagnation and phase-gate verdicts with their parameters; journal tails and archive presence; active violations and rate-limit wait; export target/status; and unresolved file or backend errors. A missing metric is “no metric yet”, not zero. An indeterminate backend outcome is “unknown”, not success.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).