DekEn

อัปเดต 2026-09-07

Byte-identity / SACRED testing discipline

old physics untouched

Every new physics feature must prove, with an explicit regression suite, that it leaves every existing solve path bit-for-bit unchanged (max|Δ|=0.0, or measured to machine precision where floating-point order differs) before it can ship — internally the shared kernels new work is required to leave untouched are called 'SACRED'.

เมื่อไรจึงใช้
  • You're adding a new fluid mode, node type, or honesty detector and need to know the bar for 'safe to merge'.
  • A code review is checking whether a change that touches shared solver code actually preserves old behaviour, not just whether new tests pass.
  • You're deciding whether a numerical difference between two solves is a real bug or expected floating-point noise — SACRED tests establish which anchors must read exactly zero, not 'close enough'.
คำนวณอย่างไร

New physics is gated behind a no-op condition (an inactive feature must evaluate to the identical old formula) so the old code path is provably untaken when the feature is off, then a dedicated byte-identity test suite (EPANET benchmark networks, a fine-tolerance verification suite, split-pipe equivalence oracles) re-runs the OLD cases and asserts the numbers didn't move.

ข้อควรระวัง
noteA byte-identity claim is only as strong as the test that checks it — 'should be identical' without an actual max-difference assertion in a committed test is not SACRED, it's a hope.
noteByte-identity failures have caught real deployment bugs unrelated to the new feature itself — a numeric-library major-version API removal only surfaced in the deployed image, not local tests, because the local environment and the deployed image ran different library majors.
ที่เกี่ยวข้อง