claude:dev_process
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| claude:dev_process [2026/04/30 12:08] – mirror 8-phase dev process from memory markus_fritsche | claude:dev_process [2026/05/02 15:57] (current) – Phase 6: add worked example for 'state the contract explicitly' (patch 0012, h264 SCALING_MATRIX) markus_fritsche | ||
|---|---|---|---|
| Line 15: | Line 15: | ||
| ===== Phase 3 — Baseline Measurements ===== | ===== Phase 3 — Baseline Measurements ===== | ||
| - | Take concrete measurements //before// any changes | + | Take concrete measurements //before// any changes. Paste raw output into DokuWiki at capture time — verbatim, not paraphrased. The Phase 5 artifact is the raw data, not Claude' |
| + | |||
| + | **Real data, not theatre.** Phase 3 exists to use AI capacity for absorbing wide, low-level instrumentation a human reader would skim past. Attaching strace / perf / ftrace / eBPF / custom tripwires to the process under test is real Phase 3; scraping mpv's stdout dropped-frame counter is not. Discriminator: | ||
| + | |||
| + | **Anti-fabrication: | ||
| + | |||
| + | * Every cited value traces to a visible tool invocation or verbatim paste-in. If a measurement wasn't taken, write "not measured" | ||
| + | * Raw before derived. A derived number (FPS, p99, error rate) appears alongside the raw stream it came from, never alone. | ||
| + | * Rig failure is the finding. Empty strace, dead UART, perf counter that didn't increment → that //is// the Phase 3 result. Loop back to Phase 2 to fix the rig; do not synthesize plausible-looking baseline data to keep momentum. | ||
| * **If baseline reveals the Phase 1 metric was tracking the wrong thing → loop back to Phase 1** with the corrected target. | * **If baseline reveals the Phase 1 metric was tracking the wrong thing → loop back to Phase 1** with the corrected target. | ||
| * Example: "max H.264 FPS" Phase 1 metric, but baseline shows DMA-setup + sync overhead dwarfs decode → real metric is bytes-copied-per-second / EGL surface-import time, not FPS. | * Example: "max H.264 FPS" Phase 1 metric, but baseline shows DMA-setup + sync overhead dwarfs decode → real metric is bytes-copied-per-second / EGL surface-import time, not FPS. | ||
| + | |||
| + | **Measurements describe what the system //does//, not what it //should do//.** Baseline data is evidence, not a specification. Do NOT derive API call sequences, struct layouts, or parameter values from observed behaviour (strace, perf, example output). Observable behaviour may reflect bugs, workarounds, | ||
| ===== Phase 4 — Plan ===== | ===== Phase 4 — Plan ===== | ||
| Line 30: | Line 40: | ||
| ===== Phase 6 — Implementation ===== | ===== Phase 6 — Implementation ===== | ||
| - | Execute the plan. Scope strictly to what was planned — resist feature creep, refactor-creep, | + | Execute the plan. Scope strictly to what was planned — resist feature creep, refactor-creep, |
| + | |||
| + | **Contract before code.** Before writing or modifying any call site: | ||
| + | |||
| + | * Read the API contract — kernel docs, header comments, and upstream source for every call touched. | ||
| + | * State the contract explicitly before implementing against it (in the plan, the commit message, or a comment — somewhere reviewable). | ||
| + | * If the contract cannot be found: stop and surface the gap. Don't infer it from baseline behaviour or sibling code. | ||
| + | |||
| + | **Copying from baseline measurements is not implementation. It is transcription of potentially broken behaviour.** A deliverable that matches baseline bytes but violates the API contract is not a deliverable — it is a deferred bug. | ||
| + | |||
| + | ==== What "state the contract explicitly" | ||
| + | |||
| + | Worked example: '' | ||
| + | |||
| + | < | ||
| + | VAAPI signals " | ||
| + | implicitly: the consumer (ffmpeg-vaapi, | ||
| + | VAIQMatrixBufferH264 alongside RenderPicture iff | ||
| + | sps_scaling_matrix_present_flag || pps_scaling_matrix_present_flag. | ||
| + | When the bitstream uses default (flat) scaling, no IQMatrixBuffer | ||
| + | arrives [...] | ||
| + | |||
| + | Earlier draft of this patch unconditionally omitted SCALING_MATRIX in | ||
| + | FRAME_BASED. That's corpus-correct (bbb has no explicit scaling | ||
| + | lists) but the wrong predicate: the kernel-side gating is by | ||
| + | " | ||
| + | explicit scaling lists must submit SCALING_MATRIX in either mode. | ||
| + | |||
| + | Contract verification (audit_0008_decode_params_2026-05-01.md + | ||
| + | hantro_h264.c:: | ||
| + | matrix when SCALING_MATRIX is in the control batch and falls back | ||
| + | to spec-defined defaults when absent. Mode-independent. | ||
| + | </ | ||
| + | |||
| + | What this gets right: | ||
| + | |||
| + | * **Contract first** — per-control rules cited from kernel doc ('' | ||
| + | * **Corpus-correct ≠ spec-correct, | ||
| + | * **Then** the diff implements one branch per contract clause: SPS/ | ||
| + | |||
| + | Mirror format anywhere reviewable: PR description, | ||
| ===== Phase 7 — Verification Measurements ===== | ===== Phase 7 — Verification Measurements ===== | ||
| Line 52: | Line 102: | ||
| Several recurring failures in prior work codify into individual rules — observer-first, | Several recurring failures in prior work codify into individual rules — observer-first, | ||
| - | //"The seven-year-old with the chainsaw can do real work. Watch the blade, not the smile."// | + | |
| + | |||
claude/dev_process.1777550904.txt.gz · Last modified: by markus_fritsche
