artdag: cost-based scheduling — critical path + makespan + speedup + 13 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 56s

cost.sx: injected cost-fn keeps media costs opaque. critical-path = longest
weighted path (= unlimited-worker makespan); makespan sums each batch's slowest
node (full plan == critical path, serial == total-work); speedup = work/makespan.
cost 13/13, total 115/115.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-07 12:15:51 +00:00
parent 985dbb4c8f
commit afe69cbdc6
6 changed files with 203 additions and 6 deletions

View File

@@ -30,7 +30,9 @@ edges.
## Status (rolling)
`bash lib/artdag/conformance.sh`**102/102** (6 suites: dag, analyze, plan, execute, optimize, fed)
`bash lib/artdag/conformance.sh`**115/115** (7 suites: dag, analyze, plan, execute, optimize, fed, cost)
Base roadmap (Phases 16) COMPLETE. Now extending.
## Ground rules
@@ -136,6 +138,15 @@ lib/artdag/optimize.sx lib/artdag/federation.sx
## Progress log
- **Ext: cost-based scheduling** (cost suite 13/13, total 115/115).
`lib/artdag/cost.sx`: an injected `cost-fn (op params)` keeps media-op costs opaque
(`const-cost`, `op-cost table`). `critical-path` = longest weighted path (finish-time
fold over topo order) = min makespan with unlimited workers. `makespan dag plan
cost-fn` sums each batch's slowest node — full plan (cap 0) makespan == critical
path, serial (cap 1) == `total-work`. `speedup` = total-work / makespan. Verified
weighted paths follow heavy ops and capped makespan never dips below the critical
path.
- **Phase 6 — Federation (shared content-addressed cache)** (fed suite 15/15, total
102/102). `lib/artdag/federation.sx`: an instance = `{:cache <persist kv> :prov
{cid->origin-peer}}`. `fed-export` dumps the whole cache as `{:cid :result :peer}`