Design decisions

7. Cross-cutting

#DecisionStatusCurrent leanDepends onWhere
7.1Checks & predicates (assert)Revised 2026-11-20 (v2.2)One predicate keyword (assert): always checked (local + judge; lints on mut; feeds proven flow facts). assume deleted (use typed read() bounds, read(gen:), @checker, and debug(...)). Domain indexing never checked; List/Str/a.raw checked unless proven or in unchecked:7.9§16, §19.1, research/archive/architecture/syntax-bakeoff-2-v21.md
7.2Overflow in release buildsSettled 2026-11-19proven safe: no check; provably reachable: a warning with the bound; unknown: trapped in local builds, unchecked in the judge build1.1research/archive/RECOMMENDATIONS.md §4, plan/30-compiler.md
7.3Trace data contractOpenspans, typed values, writes old → new, call tree, test and part boundaries6.5plan/50-debugging.md
7.4Zero-cost & max-N judge guaranteesLocked v2.2 (2026-11-20)No using namespace std; + wrap user code in namespace cp_user { ... }; 8-B ?Int/?F64, 4-B Mod<P> (P <= 2^31-1), 4-B I32 stamps in opt-in std.marks.Marks<D>, vector<uint8_t> never vector<bool>, lexically scoped @memo with runtime flat (<= 2^24, 2^26 for tri-state ?Bool) vs salted flat hash dispatch, lazy Rooted LCA + CSR kids, index-before-place-borrow lowering preventing vector UAF1.3, 5.9§16, §18.2, §19.6, §19.8
7.5C++ interopOpen@cpp blocks with checks at the boundary1.1
7.6Remaining syntaxLocked v2.2 (2026-11-20)34 reserved keywords (30 contestant + 4 lib-author); single lambda x => expr; single inline-if if c: a else: b; else if -> elif diagnostic; "{val:.6f}" format specifiers§16, §19.1, docs/one-page-cheat-sheet.md
7.7TLE / MLE / overflow estimatesRevised 2026-11-20 (v2.2)from typed input bounds and domain sizes; warnings only, never errors; suppressed inside @brute, @gen, @checker, @interactor6.3, 7.2§16, §19.1
7.8Typed input drives generators and shrinkersRevised 2026-11-20 (v2)Dependent bounds (incl. record fields) + Perm<V> / Tree<V> + read(gen:) (with witness & coupled tuple reads) + @gen + automatic choice-stream shrinking. stress ... by ... DSL and Distinct/Sorted wrappers deleted6.6§16, research/archive/architecture/syntax-bakeoff-1.md Fork 6
7.9ContractsRevised 2026-11-20 (v2.2)Unified into assert (always checked), typed read() bounds, read(gen:), and @checker; assume, requires, ensures, invariant, and read() where deleted7.1§16, §19.1
7.10Compile-time constSettled 2026-11-19adopted, with a size warning for large baked tables6.7plan/18-key-features.md §3
7.11REPL on a loaded testDeferred 2026-11-19not now; cheap to add once the debug interpreter existsplan/18-key-features.md §4
7.12Command name and file extensionSettled 2026-11-19 (name is a placeholder)the binary is cpl until Ryan picks a final name, because cp clashes with Unix cp; source files are .cpplan/b0-distribution.md
7.13Editor support in the coreSettled 2026-11-19LSP with partial-parse recovery, VS Code extension and syntax highlighting are P0 (G13)plan/60-editor.md
7.14Trace viewer designSettled 2026-11-19designed fresh with its own design system; the old mock/trace-mock.html is rejected and not in the repository. What the trace must contain (7.3) is unaffected7.3plan/50-debugging.md
7.15Sample local librarySettled 2026-11-19a fresh one, inspired by popular contest libraries, not a port of ryanbai1412/cp-library; it also proves G8 and tests library pinning (G11)6.4plan/40-tooling.md
7.16test and doc for librariesSettled 2026-11-19cpl test and cpl doc work the same on the stdlib and on a user's own library6.4plan/45-dev-tools.md
7.17How conciseness is measuredSettled 2026-11-19two numbers per port: % fewer lines than the original, and % fewer than the original with library-able code strippedplan/80-validation.md §8.1
7.18Honest cpl stress & debug(...)Locked v2 (2026-11-20)One cpl stress command defaulting to in-file @brute/@checker/@interactor, escalating sizes (default up to 20), comparing line-by-line unless @checker (plus --close <eps> for floats), always compiling with -DLOCAL, shrinking every failure via choice streams, replaying debug(...) side-by-side, and printing max size, rejection rate (>50% warning), diff mode, and output diversity6.6, 7.8§16, research/archive/blind-evals/blind-critic-2-debug-pivot.md
7.19Grids, trees & collection verbsRevised 2026-11-20 (v2.2)type Cell = (Row, Col) + std.grid (p.adj4, p.adj8, Dir4, p.step, p.ray, g.transposed; .flipped_* deleted, Dir8 demoted); Rooted<V> with value-owned t.Pre, t.pos(v), from_parents, t.tour, .fold_path/.apply_path + Reversible, .ancestor, .postorder, .lift_while -> ?V, .virtual_tree; unified container verbs (.len/.is_empty, .take(), List.insert/remove, Map.remove -> ?V, m[k] f= x auto-insert, SegTree/LazySegTree .all & Action(id, (new_f, old_f), (f, val, span), over:); .absorb() deleted; Marks<D> demoted to opt-in 32-bit std.marks; 11 near-zero structures moved to examples/local-lib/)2.16, 3.1§16, §18.5, §19.4, §19.6, §19.7, §19.9