Skip to content

Commit b12494e

Browse files
committed
docs: republish the coverage figure from a re-run, and record how the psycopg probe lies
Every number in the document was re-taken at `048e28a` rather than carried over: the totals reproduce to the statement across two sessions a day apart, and the ranked table regenerates row for row from the fresh report. The decline proportion now states the exact set of statement forms it counts, because the previous wording listed seven forms and the count needed eight. Re-verifying the psycopg class-identity trap surfaced a failure mode in the probe rather than in coverage. A probe that imports psycopg before entering `sys_modules_saved()` reports zero evictions and every identity check True, which is indistinguishable from a fixed bug. That is recorded next to the result, since one retraction of this mechanism was already wrong once.
1 parent f75e826 commit b12494e

1 file changed

Lines changed: 33 additions & 11 deletions

File tree

docs/superpowers/specs/2026-07-30-sync-coverage-baseline-3.md

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,19 @@ SYNC_DSN=postgresql://sync:sync@localhost:5433/sync_w118 PYTHONIOENCODING=utf-8
2424
uv run pytest -q --cov=sync --cov-report=term-missing --cov-report=json:coverage.json -rs
2525
```
2626

27-
**97.71% of 7,234 statements, 166 missed, across 97 files.** Measured at commit `a77eb22`
28-
`origin/main` at `048e28a` merged into this branch — over a suite reporting **2,719 passed and 4
29-
skipped in 167.99s, exit 0**, under the `-n auto` scheduler `pyproject.toml`'s `addopts` selects,
30-
twelve workers on this machine. `SYNC_DSN` named `sync_w118`, used by nothing else; under `-n auto`
31-
each worker subdivides that name into `sync_w118_gw<n>` and creates and drops its own, so the
32-
pinned name itself is never created and never dropped.
27+
**97.71% of 7,234 statements, 166 missed, across 97 files** — 7,068 covered, 65 further statements
28+
excluded outright. Measured on this branch, whose `src/` and `tests/` are byte-identical to
29+
`origin/main` at `048e28a`; the branch adds documentation and nothing else, which `git diff
30+
048e28a HEAD --stat` shows. The suite reported **2,719 passed and 4 skipped, exit 0**, under the
31+
`-n auto` scheduler `pyproject.toml`'s `addopts` selects, twelve workers on this machine.
32+
`SYNC_DSN` named `sync_w118`, used by nothing else; under `-n auto` each worker subdivides that
33+
name into `sync_w118_gw<n>` and creates and drops its own, so the pinned name itself is never
34+
created and never dropped.
35+
36+
The figure was taken twice, in two sessions a day apart, and reproduced to the statement: 7,234,
37+
166, 97 files, 65 excluded, both times. Wall clock is not among the reproduced numbers and is not
38+
quoted here — the two runs took 168s and 341s, and the difference is machine contention rather than
39+
anything about the suite.
3340

3441
`-rs` is in the command because the skip list is evidence rather than noise here, for the reason
3542
the fourth qualification below gives. It changes no figure.
@@ -111,7 +118,7 @@ Stripe half has to fetch first.
111118
|---|---:|---:|---:|---:|---:|
112119
| `58257f6` — baseline 1 | 4,916 | 211 | 95.71% | 84 | 1,468 |
113120
| `5c546fa` — baseline 2 | 5,278 | 235 | 95.55% | 87 | 1,569 |
114-
| `d615b75` — here | 7,234 | 166 | 97.71% | 97 | 2,699 |
121+
| `048e28a` — here | 7,234 | 166 | 97.71% | 97 | 2,719 |
115122

116123
Between the second measurement and this one the tree grew by 1,956 statements — 37% — and the
117124
number of statements nothing executes *fell* by 69. That is the first movement in this series large
@@ -264,9 +271,12 @@ is the disagreement the weighting exists to make explicit rather than to hide.
264271

265272
## Where coverage has nothing left to tell you, and what would
266273

267-
**Forty-eight per cent of the missed statements in this tree are literal declines** — 79 of 166 are
268-
a bare `continue`, `pass`, `return None`, `return False`, `return []`, `return {}` or `return ()`.
269-
In the two indexers at the top of the ranking the proportion is higher: 18 of 25 and 8 of 10.
274+
**Forty-eight per cent of the missed statements in this tree are literal declines** — 79 of 166, or
275+
47.6%. The count is every missed line whose stripped text is exactly one of `continue`, `pass`,
276+
`return None`, `return False`, `return []`, `return {}`, `return ()` or `return set()`; that list
277+
is given in full because a proportion computed from an unstated set of forms is not a measurement
278+
anybody can check. In the two indexers at the top of the ranking the proportion is higher: 18 of 25
279+
and 8 of 10.
270280

271281
For a module in that shape, the coverage number has already told you everything it can. It says a
272282
`return None` never ran. It cannot say whether the `return None` is right, what input reaches it,
@@ -385,7 +395,19 @@ the installed `coverage 7.15.2` rather than cited:
385395
isinstance(first-set exc, first Error) = True
386396
```
387397

388-
0.85 s, no pytest involved. `coverage.inorout` resolves a dotted source argument by importing it
398+
Under a second, no pytest involved, against `coverage 7.15.2` and `psycopg 3.3.4`.
399+
400+
**The probe has a failure mode that reports the trap as absent, and it was hit while re-verifying
401+
this.** A probe that imports `psycopg` before entering `sys_modules_saved()` measures zero modules
402+
imported and zero evicted for *both* arguments, and every identity check then answers `True`
403+
because the modules are already in `sys.modules`, so they are not new to the saver and `restore()`
404+
deletes none of them. That reads exactly like a fixed bug. The probe must reach
405+
`file_and_path_for_module` with psycopg unloaded, which is what the real sequence does: coverage
406+
resolves its source argument at startup, before any test has imported anything. Anyone re-checking
407+
this should assert `"psycopg" not in sys.modules` at the top of the probe, and treat an all-`True`
408+
result as a broken probe until that assertion has passed.
409+
410+
`coverage.inorout` resolves a dotted source argument by importing it
389411
inside `coverage.misc.sys_modules_saved()`, whose `restore()` deletes every module the import added;
390412
`psycopg/errors.py` is pure Python and re-executes into a second set of exception classes, while
391413
the `psycopg_binary._psycopg` extension is cached below `sys.modules`, is not re-executed, and goes

0 commit comments

Comments
 (0)