Static school reading · Terminal implementation
Evidence, pass order and cost
Read here, then implement your own optimizer in the learner project. This page does not execute code, save answers or award results. Use the terminal tools to preserve first attempts, source versions, help and revisions.
The named U08/U09 reduction defect has passed an independent focused public-interface recheck. The owner package’s broader pending-review statements describe its original scope; the complete documented terminal route has since been exercised in a source-aware owner run. Browser and human learning are not claimed.
Get the learner project on GitHubSetup, nine lessons and contracts
Evidence, pass order and cost
A report that says “all tests passed” is incomplete without its subjects, domain and limits. Implement decide(report) to select a supported, beneficial translation and retain the previous program otherwise.
Prerequisites: Projects A and B. Hashing, execution, case accounting and report serialization are supplied.
Read the evidence before the number
EXHAUSTIVE_WITHIN_DOMAIN means every member of a declared nonempty finite domain completed equally. It does not mean every input of every size was checked. SAMPLED_NO_DIFFERENCE is weaker. UNKNOWN means required execution or coverage did not finish. INVALID means the subjects, inputs or evidence are malformed/inconsistent. COUNTEREXAMPLE records a completed mismatch.
A demonstrated counterexample is useful even if some other cases were not completed. A cutoff on the last case prevents an exhaustive success. Neither conclusion depends on whether the average runtime looked good.
Commit item 07a.
Every receipt binds the original/candidate programs, input contract and listed inputs. The edit-chain check detects changes that were never described by a rewrite event. Current identities, successful rule checks and completed domain coverage are separate requirements.
Decide whether the change earns its place
This workbench counts executed IR operations with unit weights. Phi assignments count as value work; their simultaneous group is one interpreter fuel step. This model is reproducible, but it is not machine cycles.
Compare identical input lists. A safe hoist may add a load on a zero-trip input while saving many loads on longer runs. Report those per-input changes and the total under the chosen workload. Do not call an aggregate benefit a worst-case speedup.
Commit item 07b. Require current identities, a checked rule chain, exhaustive required-domain success, complete comparable costs and a strict aggregate improvement. A correct no-op ties the baseline rather than improving it.
Project C: make a defensible decision
node cli.mjs check 07 work --help-used none
node cli.mjs optimize work calibration.json scalar --learner-policy --help-used none
node cli.mjs pipeline work calibration.json scalar,constants --learner-policy --help-used noneInspect a retained candidate as well as an adopted one. In a multi-pass experiment, keep every boundary; a later pass can mask an earlier bad transformation. Evidence remains local and editable, so its digest is a binding identifier rather than an authenticity certificate.
Run scalar,constants and then constants,scalar on your branch example. Explain a stage that changes nothing, a stage that exposes a later opportunity, and whether the final costs differ. No order is required to win. The pipeline records each rejected candidate before continuing from the last accepted program, then checks the aggregate chain. An intermediate failure remains visible even when the final candidate is useful.
Inspect the scalar job's domain: one inclusive i8 range and an empty heap produce exactly 256 distinct inputs. Change its upper endpoint to 127. The new receipt may still say EXHAUSTIVE_WITHIN_DOMAIN, but its domain identity and claim are smaller. Restore the original range before comparing costs. A product of two full i8 axes has 65,536 cases; the default execution cap will leave unstarted cases, so it must not be relabeled exhaustive.
Translation validation checks a particular translation; it complements rather than replaces compiler testing. See the original Necula paper and the bounded-checking discussion in Alive2.