Skip to content

Validate scheduler models and cache paths - #19

Merged
timkpaine merged 1 commit into
mainfrom
tkp/readiness
Oct 6, 2026
Merged

timkpaine merged 1 commit into
mainfrom
tkp/readiness

Conversation

@timkpaine

Copy link
Copy Markdown
Member

The first repository to flip, read against the principles in FLIP_READINESS.md by an adversarial review. Every accepted finding lands here with a test.

Behaviour

  • plan_split("adaptive") refuses with PostureError saying where adaptive is planned, instead of NotImplementedError from a public name. The posture stays in the taxonomy because every consumer speaks it.
  • WorkSplit, QueryProfile, NodeCost and LinkRate gain check(), called by the validator and by every use site (execute_split, estimate, is_stale_for, is_stale, both cache writes). model_copy(update=...) skips validation and these models are copied; tests pin that an invalid copy is refused where it is used. extra="forbid" on all of them. SplitExecution validates its own figures.
  • RowRange.slice and RowBatch.slice require 0 <= start <= stop <= len; RowBatch refuses a negative start. Python slicing would clamp or wrap these silently.
  • profile_from_spans refuses a reversed or negative span.
  • ProfileCache expands ~, percent-encodes every key component and refuses any entry that is not a file directly under the root. Entries written under the old naming are not found and get re-measured.

Claims

  • The posture docstring's 27.6 / 18.6 ms comparison is restated with the 11.9 ms split from the 2026-08-12 ledger entry; its "40%" sentence was wrong. The 11.2 / 14.6 ms plan-time figures had no ledger row and are gone. "~1.6x between hosts" is 1.41x (2026-08-16); "13 ms host" is 12.3 ms. Analytic examples are labelled analytic.
  • README: "declines to bother", "enforces it" and "allocates nothing per call" overclaimed and are corrected; the distinct-count statement is about exact counts; every code block now runs as written and test_readme.py runs them in order; an install section says how to install from the repository.

Quality gates

  • ARG enabled (tests exempt, per the review rule) and the two production hits fixed; check-types is part of make checks and its 21 diagnostics are fixed; classifiers trimmed to the CPython 3.12 CI tests; orphan coverage omit removed; the vacuous test_all asserts the exported surface.
  • Wiki: Python 3.12 to match the metadata, no conda-forge claim, install from the repository, headings no longer named after steps.

Dispositions of the findings not changed here (posture taxonomy, host as measurement data, template-managed workflow and Makefile items) are recorded in FLIP_READINESS.md.

Refuse adaptive by name instead of raising NotImplementedError; validate every model at its use sites, not only at construction, since model_copy skips validation; check sub-range bounds and refuse reversed timing spans; keep cache entries directly under the cache root with percent-encoded keys; restate the numeric claims against the ledger; make every README block run and test that it does; add an install section; enable the unused-argument lint, wire type checking into checks, and trim the classifiers to what CI tests. Wiki pages match the package metadata.

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Test Results

115 tests  +16   115 ✅ +16   1s ⏱️ ±0s
  1 suites ± 0     0 💤 ± 0 
  1 files   ± 0     0 ❌ ± 0 

Results for commit a221e68. ± Comparison against base commit a2d3ea8.

This pull request removes 2 and adds 18 tests. Note that renamed tests count towards both.
dau_scheduler.tests.test_all ‑ test_all
dau_scheduler.tests.test_posture ‑ test_every_posture_is_reachable_or_explicitly_unimplemented
dau_scheduler.tests.test_all ‑ test_the_documented_surface_is_exported
dau_scheduler.tests.test_posture ‑ test_every_posture_is_reachable_or_refused_by_name
dau_scheduler.tests.test_profile ‑ test_a_copied_link_rate_is_checked_where_it_is_used
dau_scheduler.tests.test_profile ‑ test_a_copied_profile_is_checked_where_it_is_used
dau_scheduler.tests.test_profile ‑ test_a_reversed_or_negative_span_is_a_reporting_fault_not_a_cheap_node[spans0]
dau_scheduler.tests.test_profile ‑ test_a_reversed_or_negative_span_is_a_reporting_fault_not_a_cheap_node[spans1]
dau_scheduler.tests.test_profile ‑ test_cache_entries_stay_directly_under_the_root
dau_scheduler.tests.test_profile ‑ test_models_refuse_fields_they_do_not_declare
dau_scheduler.tests.test_profile ‑ test_the_cache_root_expands_a_home_directory
dau_scheduler.tests.test_readme ‑ test_the_readme_examples_run_in_order
…

@timkpaine
timkpaine merged commit ac8bd6c into main Oct 6, 2026
2 checks passed
@timkpaine
timkpaine deleted the tkp/readiness branch October 6, 2026 23:56
@timkpaine timkpaine changed the title Harden the library for public readers Validate scheduler models and cache paths Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant