Ray's Knowledge Base
Unlock

Prove cheaply first, and commit only the task's hunks

PreferenceVerified 4 Oct 2026Holds anywhere
Preference. A rule, why it holds, and how to apply it.

Rule#

  • Before a long proof chain (suites, sanitizers, benchmark), grep the tests for assertions of the old behaviour the change reverses and run those few test files first. Make every proof script stop at the first failing step and order steps fast to slow. Do not edit a running sh script; sh reads it as it goes.
  • When the tree holds another session's uncommitted edits in a file the task also changed, stage only the task's hunks and prove the staged version compiles alone against HEAD (a fresh object file). Do not pull the other session's work in to make it build. Ask before choosing between the two options.

Why#

A late suite failure from a reversed-behaviour test wasted a 10 to 25 minute chain, and a failed chain left a second chain running in parallel. The user wants clean commits.

How to apply#

Grep for the old behaviour before the chain; use git add -p and a clean-object compile check for shared files.

Also found by searching

  • long proof chain failed late on a test of the old behavior
  • working tree has another session's edits in the same file, how to commit