From 049015da3a8150fbf32bc8fd33c66eea55dc1861 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Sun, 6 Dec 2026 14:33:58 +0100 Subject: [PATCH 1/5] docs(research): register the second look at the testing program and the #1672 prediction Adds ten records under I018 from a second pass over the fix history behind #1595. Experiments X044-X049: whether the seven fix families hold the bugs that change results (refuted), a gate that a fix PR has a test failing on its base (refuted), Markdown readers against markdown-it-py on five past fixes (supported), unit invariance of the statistics on eight float fixes (refuted), tree-sitter-bash and bashlex as a reference for the shell readers (refuted), and which PRs wrote the code that fix PRs change (refuted). X050 is the prediction of #1672, registered as planned before its check lands. Findings F032-F034: the fix series are not where most bugs that change results are; where a reference parser exists, one differential check covers the fixes of a hand-written reader; a quarter of the fixes change code that an earlier fix wrote, within days. Signed-off-by: Anton Volkov --- dokimi/research/records/experiment/X044.md | 43 ++++++++++++++++++ dokimi/research/records/experiment/X045.md | 35 +++++++++++++++ dokimi/research/records/experiment/X046.md | 52 ++++++++++++++++++++++ dokimi/research/records/experiment/X047.md | 39 ++++++++++++++++ dokimi/research/records/experiment/X048.md | 29 ++++++++++++ dokimi/research/records/experiment/X049.md | 41 +++++++++++++++++ dokimi/research/records/experiment/X050.md | 38 ++++++++++++++++ dokimi/research/records/finding/F032.md | 28 ++++++++++++ dokimi/research/records/finding/F033.md | 29 ++++++++++++ dokimi/research/records/finding/F034.md | 30 +++++++++++++ 10 files changed, 364 insertions(+) create mode 100644 dokimi/research/records/experiment/X044.md create mode 100644 dokimi/research/records/experiment/X045.md create mode 100644 dokimi/research/records/experiment/X046.md create mode 100644 dokimi/research/records/experiment/X047.md create mode 100644 dokimi/research/records/experiment/X048.md create mode 100644 dokimi/research/records/experiment/X049.md create mode 100644 dokimi/research/records/experiment/X050.md create mode 100644 dokimi/research/records/finding/F032.md create mode 100644 dokimi/research/records/finding/F033.md create mode 100644 dokimi/research/records/finding/F034.md diff --git a/dokimi/research/records/experiment/X044.md b/dokimi/research/records/experiment/X044.md new file mode 100644 index 000000000..dd66cc885 --- /dev/null +++ b/dokimi/research/records/experiment/X044.md @@ -0,0 +1,43 @@ +--- +id: X044 +type: experiment +title: Whether the seven fix families hold the bugs that change results +date: '2026-12-06' +idea: I018 +hypothesis: "The seven fix families that item 1 of #1595 targets hold most of the sampled bugs that could change a number or a verdict." +outcome: refuted +links: +- https://github.com/intel/dokimi/issues/1595 +- https://github.com/intel/dokimi/issues/1595#issuecomment-7457231134 +--- + +## Setup +- **Sample:** the escape classification of the study behind #1595: 240 of the 420 fix PRs that touch the package and merged from 2026-10-13 to 2026-12-02, drawn with a fixed seed, of which 225 are defects. Each defect carries a trigger (`common`, `plausible`, `contrived`), an impact (`verdict`: it could change a number, verdict, cost or exit status that dokimi reports; `crash_or_message`; `none_user_visible`) and who found it. +- **Families:** the keyword families of #1595's table, matched on the title and the first 600 characters of the body. A PR can match several. +- **The hypothesis is the assumption behind the order of item 1.** It was written down with this analysis, not before it. + +## Result +| Family | Sampled bugs | Contrived trigger | Could change a number or verdict | +|---|---:|---:|---:| +| Bad input files | 36 | 7 | 3 | +| Exit codes | 36 | 5 | 6 | +| Budget stops, partial results | 25 | 7 | 6 | +| Encoding | 20 | 14 | 0 | +| Float extremes | 15 | 7 | 8 | +| Unlistable directories | 13 | 3 | 4 | +| Superlinear regexes | 12 | 6 | 0 | +| In no family | 114 | 16 | 61 | + +- **61 of the 86 bugs with verdict impact are in no family (71%),** and so are 35 of the 53 with a common trigger. +- **Who found the 114 in no family:** a real run 34, a sweep of sibling sites 26, the author 22, review 18. +- **Encoding and regexes hold no bug with verdict impact.** 14 of the 20 encoding bugs have a contrived trigger, and 8 of the 12 regex bugs are not visible to a user. +- **Float extremes,** which item 1 leaves as a control, has the highest share of verdict bugs among the seven: 8 of 15. +- **Outside the families, 53 bugs have verdict impact and a trigger that is not contrived.** The classification gave 37 of them no class-level check, and 28 of those a unit test of the one site. A real run found 15, the author 12, a sweep 10, review 9. + +The labels are one model's reading of the PR and issue text, and the families are keyword matches. + +## Evidence +- local run: the 225 classified fix PRs recounted by family, trigger, impact and finder diff --git a/dokimi/research/records/experiment/X045.md b/dokimi/research/records/experiment/X045.md new file mode 100644 index 000000000..b7972c30b --- /dev/null +++ b/dokimi/research/records/experiment/X045.md @@ -0,0 +1,35 @@ +--- +id: X045 +type: experiment +title: A gate that a fix PR has a test failing on its base +date: '2026-12-06' +idea: I018 +hypothesis: Some merged fix PRs carry no test that fails without the fix, so a gate that runs a fix PR's tests on its base would refuse them. +outcome: refuted +links: +- https://github.com/intel/dokimi/issues/1595 +- https://github.com/intel/dokimi/issues/1595#issuecomment-7457231134 +--- + +## Setup +- **Sample:** 50 fix PRs drawn with a fixed seed from the 225 classified defects of X044. +- **Replay:** for each PR, the tree at its squash commit and the tree at the parent. The PR's whole change under `tests/` is copied onto the parent tree, so the parent has the PR's tests and not its package change. The PR's test files run in both trees. +- **Counted:** a test that passes at the merge commit. It is fail-to-pass when it fails, errors or cannot run at the parent. +- **A new test function** is one whose name no test file had at the parent. + +## Result +- **Every fix has a test that does not pass without it: 50 of 50.** + - In 45 a test fails on an assertion at the parent. + - In 4 the test file imports a name the fix adds, so none of its tests runs at the parent. + - In 1 (#1327, FIFOs) the tests hang at the parent until the 900 s limit. +- **A gate at the PR level would have refused none of the 50.** +- **Test by test, 27% of the new test functions pass without the fix:** 189 of 711, in 31 of the 50 PRs. Without #1102, which adds a file of 88 tests of heredoc reading, it is 116 of 623 (19%). In 5 PRs more than half of the new tests pass without the fix. +- **Most of those tests check the other side of the boundary the fix moved,** by their names ("is still accepted", "stays a path", "renders as before"). That is a reading of about 60 names, not a labelled sample, so the count is no gate either. + +A renamed test counts as new. The oldest PR of the sample merged on 2026-10-14, and its trees ran with the current test dependencies. + +## Evidence +- local run: 50 fix PRs, two trees each, 1,861 tests that the PRs added or changed diff --git a/dokimi/research/records/experiment/X046.md b/dokimi/research/records/experiment/X046.md new file mode 100644 index 000000000..cb1f522bf --- /dev/null +++ b/dokimi/research/records/experiment/X046.md @@ -0,0 +1,52 @@ +--- +id: X046 +type: experiment +title: Markdown readers against a reference parser, on five past fixes +date: '2026-12-06' +idea: I018 +hypothesis: A check that compares dokimi's Markdown readers with markdown-it-py, on the CommonMark spec examples and on real Markdown files, flags most past fixes of those readers at their parents. +outcome: supported +links: +- https://github.com/intel/dokimi/issues/1595 +- https://github.com/intel/dokimi/issues/1595#issuecomment-7457231134 +- https://github.com/intel/dokimi/issues/1672 +- https://github.com/intel/dokimi/issues/973 +- https://github.com/intel/dokimi/issues/974 +- https://github.com/intel/dokimi/issues/780 +- https://github.com/intel/dokimi/pull/168 +- https://github.com/intel/dokimi/pull/705 +- https://github.com/intel/dokimi/pull/1045 +- https://github.com/intel/dokimi/pull/1049 +- https://github.com/intel/dokimi/pull/1325 +--- + +## Setup +- **Readers:** `novelty.spans.segment` (which lines are code, headings, comments), `repos.l0.markdown.split` (which lines are fenced content) and `novelty.routing.headings_as_queries` (the level 2 and 3 headings). +- **Reference:** the block tokens of `markdown-it-py` with its CommonMark preset. It is already a dependency of the package. +- **Compared:** block structure only. A discrepancy is a line the reference takes as code, a heading or a comment block and the reader takes as something else, or the reverse. A leading front matter block is cut for both sides. +- **Inputs:** the 652 examples of the CommonMark 0.31.2 spec, of which the 2 that start with `---` are left out, and 228 real Markdown files: 126 files of a skills content repository and 102 files of dokimi's own `docs/` and `data/`. The real files are those of 2026-12-06, not of the date of each replayed tree. +- **Replay:** on the parent and the squash commit of five fixes of these readers, and on snapshots of `main`. The check was written from the spec and the real files, and was not changed after the replay. + +## Result +| Fix | Reader | Discrepancies before the fix | After | Flagged before the fix | +|---|---|---:|---:|---| +| #168 | `headings_as_queries` | 30 (27 on real files) | 3 | yes | +| #1049 | `segment` | 619 (496 on real files) | 563 | yes | +| #1045 | `segment` | 563 (446 on real files) | 50 | yes | +| #1325 | `segment` | 50 | 41 | yes | +| #705 | `split` | 11 | 11 | no | + +- **4 of the 5 fixes are flagged at their parent.** #705 fixes the line numbers a reader reports, which the check does not compare. +- **On the snapshot of 2026-10-20 the check reports 496 discrepancies on real files:** 446 lines of HTML comments read as prose, licence headers in 122 of the 228 files, and 50 lines in 4 skills where code under a longer fence was read as prose or as headings. A real run found both on 2026-11-19 (#973, #974). The classification of X044 had given #1045 and #1325 no class-level check. +- **#1045 added 14 new discrepancies on spec examples,** and 9 of them are still on `main`. +- **`main` (19e52226):** none on the 228 real files, and none on the 827 Markdown files of the repository. 55 on spec examples: 41 in `segment`, 11 in `split`, 3 in `headings_as_queries`. They are code and headings inside list items and block quotes, tabs, and Setext headings of level 2. They are not triaged, and some will be by design. +- **13 modules define their own code-fence regex,** with at least five different rules between them. The clone check does not see them. +- **Cost:** 186 lines, 3.6 s for the 878 documents. + +The check covers 3 of the 13 modules and 5 fixes. + +## Evidence +- local run: 878 documents through three readers, on 15 trees diff --git a/dokimi/research/records/experiment/X047.md b/dokimi/research/records/experiment/X047.md new file mode 100644 index 000000000..b3cf58dae --- /dev/null +++ b/dokimi/research/records/experiment/X047.md @@ -0,0 +1,39 @@ +--- +id: X047 +type: experiment +title: Unit invariance of the statistics, on eight float fixes +date: '2026-12-06' +idea: I018 +hypothesis: A check that the paired test and the mean intervals give the same p and verdict for the same scores in another unit flags most float fixes of the statistics at their parents, at scales a run can produce. +outcome: refuted +links: +- https://github.com/intel/dokimi/issues/1595 +- https://github.com/intel/dokimi/issues/1595#issuecomment-7457688120 +- https://github.com/intel/dokimi/pull/540 +- https://github.com/intel/dokimi/pull/818 +- https://github.com/intel/dokimi/pull/1227 +--- + +## Setup +- **Functions:** `paired_test`, `mean_ci` and `bootstrap_ci` of `eval/stats.py`. +- **Data:** 60 seeded datasets of judge-like scores, integers from 0 to 100, 2 to 14 pairs. +- **Scales:** each dataset is run as it is and times 2**k, which is exact in binary floating point. Moderate k: ±10, ±20, ±40. Extreme k: ±200, ±500, ±900. +- **Checked:** no exception and no NaN or infinity in a result; the same p; the same `significant`; a mean that is not 0 is not reported as 0; where the scaled value is 1 or more, the reported mean and interval ends are the base ones times the scale. +- **Replay:** on the parent and the squash commit of the 8 fixes of the float-extremes family that change `eval/stats.py` or `eval/sign_flip.py`: #240, #540, #572, #641, #770, #818, #867 and #1227. + +## Result +- **The check flags 2 of the 8, and neither at a scale a run produces.** + - #540: an exception or a NaN at 2**900 only, scores times about 1e270. + - #818: the p and the verdict of the paired test changed when the scores were scaled by 2**-40 (about 1e-12) or less. An absolute tie width read deltas that small as ties. There is no violation at 2**-10 or 2**-20. +- **Not flagged:** #572, #641 and #770 (values within a few decades of the float maximum, which these scales do not reach), #867 (exact sums), #240 and #1227. +- **With one property added after that result,** that a reported mean is within 5% of the scaled one, the check flags #1227 too. It also shows that #818 brought in what #1227 fixed 8 days later: a mean difference of 1.3e-11 was reported as 0.0001. +- **`main` (19e52226):** `mean_ci` and `bootstrap_ci` report a mean below 5e-5 as 0.0, which is their documented rounding to 4 places. `paired_test` reports a mean difference between 0.005 and 0.1 with one significant digit, 0.00773 as 0.01. +- **What a run does produce from this family** is narrower: a small number printed as zero (#1259, #1357) and a NaN or infinity that reaches a gate (#313). A check for those two was not run. + +The calibration tests of X035 already scale by 10. Widening that relation to 2**±40 would have flagged #818. + +## Evidence +- local run: 2,160 scaled calls per tree, on 21 trees diff --git a/dokimi/research/records/experiment/X048.md b/dokimi/research/records/experiment/X048.md new file mode 100644 index 000000000..e39251934 --- /dev/null +++ b/dokimi/research/records/experiment/X048.md @@ -0,0 +1,29 @@ +--- +id: X048 +type: experiment +title: tree-sitter-bash and bashlex as a reference for the shell readers +date: '2026-12-06' +idea: I018 +hypothesis: tree-sitter-bash or bashlex reads common heredoc and quoting forms as bash does, so one of them can be the reference for a differential check of the shell readers. +outcome: refuted +links: +- https://github.com/intel/dokimi/issues/1595 +- https://github.com/intel/dokimi/issues/1595#issuecomment-7457688120 +--- + +## Setup +The check of X046 needs a reference. For the shell readers (`context/shell.py` and the heredoc readers of `text_spans.py`, 9 fixes from 2026-11-04 to 2026-12-01) the candidates are two Python parsers: tree-sitter-bash 0.25.1 and bashlex 0.18. + +Ten constructed snippets went through both: a heredoc with a command after it on the opener line, a plain heredoc, a quoted delimiter, `<<-` with tabs, two heredocs on one line, a heredoc inside `$(...)`, a separator inside `$(...)`, an ANSI-C string, `case`, and a comment. The first snippet, made of `cat` and `echo` only, was also run in bash 5.2.21. + +## Result +- **tree-sitter-bash** reports a parse error on `cat < +## Setup +- **Fix PRs:** the 420 that touch the package and merged from 2026-10-13 to 2026-12-02. +- **Origin:** the package lines a fix PR's squash commit deletes or rewrites are blamed at its parent (`git blame -w -M -C`), blank and comment lines left out, and each blamed commit is mapped to its PR. A fix that only adds lines is blamed on the lines around each added hunk (9 PRs). 418 PRs have blamed lines. +- **Later fixes of a PR:** a later fix PR counts for a PR when a fifth or more of its fixed lines come from that PR. Rates per PR are over the PRs merged by 2026-11-18, so that each had two weeks to draw a fix. +- **The hypothesis states the picture behind item 2 of #1595.** Its threshold of a tenth was set with this analysis, not before it. + +## Result +| Most of the fixed lines came from | Fix PRs | Share | +|---|---:|---:| +| a feature PR | 160 | 38% | +| code older than 2026-10-13 | 125 | 30% | +| an earlier fix PR | 105 | 25% | +| a refactor or other PR | 28 | 7% | + +- **A quarter of the fixes change code that an earlier fix wrote,** and the share rose over three periods: 11%, 26%, 29%. +- **Code a fix wrote is fixed again after a median of 4 days.** For code from a feature PR it is 14.5 days. Over all origins since 2026-10-13 the median is 10 days, and 41% are fixed within a week. +- **Each fix PR is followed by 0.74 fix PRs that change its lines,** and each feature PR by 1.82. 38% of the fix PRs and 63% of the feature PRs are fixed later. Per 1,000 added lines a fix PR draws 2.55 later fixes and a feature PR 1.52. +- **By family,** of the fixes whose title matches it: budget stops and partial results 52% from an earlier fix, encoding 38%, exit codes 22%, regexes 20%. +- **60 PRs were each fixed by 3 or more later fixes,** and they hold 365 of the 635 links. The top ones are large feature PRs: #25 with 20 later fixes, #82 and #68 with 17 each, #31 with 13. +- **In 26 pairs read by their titles,** most later fixes handle the next input shape at the same lines (#761 then #796, #189 then #233, #1227 then #1259). A few repair what the earlier fix added (#419 then #541, #454 then #743). + +A later fix that rewrites a line does not prove that the line was wrong, so "fixed again" is an upper bound on regressions. Blame follows a moved line only within one commit. + +## Evidence +- local run: 420 squash commits blamed at their parents, 635 links from a fix to an origin PR diff --git a/dokimi/research/records/experiment/X050.md b/dokimi/research/records/experiment/X050.md new file mode 100644 index 000000000..a9129d250 --- /dev/null +++ b/dokimi/research/records/experiment/X050.md @@ -0,0 +1,38 @@ +--- +id: X050 +type: experiment +title: "The Markdown reference check of #1672 in its first four weeks" +date: '2026-12-06' +idea: I018 +hypothesis: "In the 4 weeks after the Markdown reference check of #1672 merges, no organic fix PR fixes, in a reader the check covers, a code, heading or comment line read as something else, and organic fix PRs that name a Markdown block in their title fall significantly below the baseline of 1.4 per 100 merged PRs." +outcome: planned +links: +- https://github.com/intel/dokimi/issues/1595 +- https://github.com/intel/dokimi/issues/1595#issuecomment-7409606670 +- https://github.com/intel/dokimi/issues/1672 +--- + +## Setup +Registered before the check lands. #1672 turns the check of X046 into a test with a baseline of today's 55 discrepancies on spec examples, which only shrinks. + +- **Window:** the 4 weeks after the PR of #1672's steps 1 and 2 merges. +- **Counted:** merged PRs that fix package code and whose title names a Markdown block: a fence, a Setext heading, indented code, a code block, an HTML comment, front matter or a heading. PRs labelled `testing-strategy` belong to the program and are not counted. +- **Baseline:** 13 such fix PRs from 2026-10-13 to 2026-12-02, out of 918 merged PRs, which is 1.4 per 100. 8 of the 13 merged since 2026-11-16. +- **Test:** one-sided Poisson at the window's own count of merged PRs, p < 0.05. At the baseline's 126 merged PRs a week, the threshold is 2 fixes, against 7 expected. +- **Misses:** each counted fix in the window is read by hand. + - A fix, in a reader the check covers at that time, of a code, heading or comment line read as something else is a miss. + - A fix of inline structure (code spans, links, reference definitions), of the line numbers a reader reports, or of a reader the check does not cover yet is out of scope and is reported apart. +- **Reported, with no threshold:** + - the PRs where the test failed and the merged head passes it, a lower bound, since `make ci-local` runs the tests before the push; + - rows added to the baseline, each of them a waiver, and the rows left without a decision. #1672 plans a decision for every row within the window: fixed, or kept with its reason. That is a plan, not part of the hypothesis; + - the test's run time, and the number of modules with their own fence regex, 13 today. + +If the spec examples cannot be vendored as a fixture (#1672, open question), the test gets other inputs, and X046's replay is rerun on them before this window starts. + +## Prediction +- **Supported:** no miss, and the rate is significantly below the baseline. +- **Refuted:** a miss, or a rate that is not significantly below the baseline, a smaller rate with p ≥ 0.05 included. Under #1595 the check is then narrowed or dropped. +- **The rate is weak evidence here.** The count is small and the title match is rough: by their titles, 8 of the 13 change which lines a reader takes as which block. The misses carry the result. diff --git a/dokimi/research/records/finding/F032.md b/dokimi/research/records/finding/F032.md new file mode 100644 index 000000000..bd1172015 --- /dev/null +++ b/dokimi/research/records/finding/F032.md @@ -0,0 +1,28 @@ +--- +id: F032 +type: finding +title: The fix series are not where most bugs that change results are +date: '2026-12-06' +experiments: +- X044 +- X047 +confidence: med +links: +- https://github.com/intel/dokimi/issues/1595 +- https://github.com/intel/dokimi/issues/1595#issuecomment-7457231134 +--- + +## Statement +The fix families with the most PRs are mostly crashes and messages on odd input. Of the 86 sampled bugs that could change a number or a verdict, 61 are in none of the seven families, and so are 35 of the 53 that normal use hits. Real runs found more of the bugs outside the families than sweeps, review or the author did. Encoding and regexes hold no bug with verdict impact, and the float fixes of the statistics that a unit check could reach are at scales no run produces. + +A count of fix PRs per family therefore ranks checks by how many PRs they save, not by what the bugs could do to a result. Sweeps for sibling sites found 36% of the sampled bugs, so the count also follows how hard a family is being searched. + +For most of the verdict bugs outside the families the classification named only a unit test of the one site. Some of them still share a class that the keyword families do not name, such as a hand-written reader of a standard format (F033). + +The labels are one model's reading of PR and issue text, with no second rater on this sample. + +## Applies to +The order of the checks in #1595, and what its metrics count: fix PRs per family next to the bugs that could change a result. diff --git a/dokimi/research/records/finding/F033.md b/dokimi/research/records/finding/F033.md new file mode 100644 index 000000000..9f08a59c1 --- /dev/null +++ b/dokimi/research/records/finding/F033.md @@ -0,0 +1,29 @@ +--- +id: F033 +type: finding +title: Where a reference parser exists, one differential check covers the fixes of a hand-written reader +date: '2026-12-06' +experiments: +- X046 +- X048 +confidence: med +links: +- https://github.com/intel/dokimi/issues/1595 +- https://github.com/intel/dokimi/issues/1672 +- https://github.com/intel/dokimi/issues/780 +--- + +## Statement +A reader that dokimi writes by hand for a standard format can be tested against a parser of that format, on the format's own examples and on real files. For Markdown the check is small and was not tuned to the fixes. It flagged 4 of 5 past fixes of three readers at their parents. On a snapshot of 2026-10-20 it reported, on real files, the two problems that a real run found a month later. It also showed that one of the fixes brought in new differences from the format, most of which are still there. + +The classification of the fix history had put those fixes down as needing a unit test of the one site. The class appears only when the reader is compared with the format, not with its own earlier output. + +The approach depends on the reference. For shell, neither Python parser that was tried reads common heredoc forms as bash does, so there is no reference short of bash itself. The Markdown check compares block structure only: it does not see inline structure or the line numbers a reader reports. + +13 modules each recognise a code fence with their own regex. A check per reader finds their differences from the format, and one shared reader removes them. + +## Applies to +Hand-written readers of Markdown in the package (#1672), and any later reader of a format that has a parser dokimi can depend on. diff --git a/dokimi/research/records/finding/F034.md b/dokimi/research/records/finding/F034.md new file mode 100644 index 000000000..c503b18f7 --- /dev/null +++ b/dokimi/research/records/finding/F034.md @@ -0,0 +1,30 @@ +--- +id: F034 +type: finding +title: A quarter of the fixes change code that an earlier fix wrote, within days +date: '2026-12-06' +experiments: +- X045 +- X049 +confidence: med +links: +- https://github.com/intel/dokimi/issues/1595 +- https://github.com/intel/dokimi/issues/1595#issuecomment-7457688120 +--- + +## Statement +A fix series is not only the same bug at the next site. In 105 of 418 fix PRs most of the fixed lines were written by an earlier fix PR, and that share rose from 11% to 29% over seven weeks. Code that a fix wrote is fixed again after a median of 4 days, against 14.5 days for code from a feature PR. Each fix PR is followed by 0.74 fix PRs that change its lines, and per added line a fix PR draws more later fixes than a feature PR does. + +By their titles, most of these later fixes handle the next input shape at the same lines, and a few repair what the earlier fix added. So the earlier fix was usually right for its case and too narrow for its class. + +The tests of a fix do prove the fix: every one of 50 sampled fix PRs has a test that does not pass without it. A gate on that would refuse nothing. What a fix PR lacks is the other shapes of the same input, which a test of the reported case does not ask for. + +Feature PRs are still the larger source: 38% of the fixes change code from a feature PR, each feature PR is followed by 1.82 fixes, and a few large feature PRs were each fixed more than ten times. + +A later fix that rewrites a line does not prove that the line was wrong, so these shares are an upper bound on regressions. + +## Applies to +The rule of item 2 of #1595 (fix the class, not the site), whose effect shows in the later fixes per fix PR, and the checks of item 1, which act on the feature PR that adds a command. From c99cdf7c6d5af00c86c3ddc635968559ad06e0cf Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Sun, 6 Dec 2026 15:04:54 +0100 Subject: [PATCH 2/5] docs(research): finder counts that add up, misses read from every fix, the fail-on-base result qualified Review of the records of this PR. X044: both finder lists left out the bugs whose finder the PR and issue text does not name, 14 of the 114 in no family and 7 of the 53. They are in the record now, so each list adds up. X050: misses are read from every organic fix PR that changes a covered reader, whatever its title. The title match is for the rate only, as #1672's prediction has it. X045 and F034: in 45 of the 50 sampled fix PRs a test fails on an assertion without the fix. In the other 5 the tests cannot be collected or hang without it, which shows that they depend on the fix, not that they check the behaviour it repairs. Signed-off-by: Anton Volkov --- dokimi/research/records/experiment/X044.md | 4 ++-- dokimi/research/records/experiment/X045.md | 3 ++- dokimi/research/records/experiment/X050.md | 4 ++-- dokimi/research/records/finding/F034.md | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dokimi/research/records/experiment/X044.md b/dokimi/research/records/experiment/X044.md index dd66cc885..e84cdc274 100644 --- a/dokimi/research/records/experiment/X044.md +++ b/dokimi/research/records/experiment/X044.md @@ -32,10 +32,10 @@ SPDX-License-Identifier: Apache-2.0 | In no family | 114 | 16 | 61 | - **61 of the 86 bugs with verdict impact are in no family (71%),** and so are 35 of the 53 with a common trigger. -- **Who found the 114 in no family:** a real run 34, a sweep of sibling sites 26, the author 22, review 18. +- **Who found the 114 in no family:** a real run 34, a sweep of sibling sites 26, the author 22, review 18. For the other 14 the PR and issue text does not say. - **Encoding and regexes hold no bug with verdict impact.** 14 of the 20 encoding bugs have a contrived trigger, and 8 of the 12 regex bugs are not visible to a user. - **Float extremes,** which item 1 leaves as a control, has the highest share of verdict bugs among the seven: 8 of 15. -- **Outside the families, 53 bugs have verdict impact and a trigger that is not contrived.** The classification gave 37 of them no class-level check, and 28 of those a unit test of the one site. A real run found 15, the author 12, a sweep 10, review 9. +- **Outside the families, 53 bugs have verdict impact and a trigger that is not contrived.** The classification gave 37 of them no class-level check, and 28 of those a unit test of the one site. A real run found 15, the author 12, a sweep 10, review 9, and for 7 the text does not say. The labels are one model's reading of the PR and issue text, and the families are keyword matches. diff --git a/dokimi/research/records/experiment/X045.md b/dokimi/research/records/experiment/X045.md index b7972c30b..34dda292b 100644 --- a/dokimi/research/records/experiment/X045.md +++ b/dokimi/research/records/experiment/X045.md @@ -25,7 +25,8 @@ SPDX-License-Identifier: Apache-2.0 - In 45 a test fails on an assertion at the parent. - In 4 the test file imports a name the fix adds, so none of its tests runs at the parent. - In 1 (#1327, FIFOs) the tests hang at the parent until the 900 s limit. -- **A gate at the PR level would have refused none of the 50.** + - For those 5 the result shows that the tests depend on the fix, not that they check the behaviour it repairs. A collection error would be the same with a wrong implementation under the new name. +- **A gate that asks for a test that fails or cannot run on the base would have refused none of the 50.** - **Test by test, 27% of the new test functions pass without the fix:** 189 of 711, in 31 of the 50 PRs. Without #1102, which adds a file of 88 tests of heredoc reading, it is 116 of 623 (19%). In 5 PRs more than half of the new tests pass without the fix. - **Most of those tests check the other side of the boundary the fix moved,** by their names ("is still accepted", "stays a path", "renders as before"). That is a reading of about 60 names, not a labelled sample, so the count is no gate either. diff --git a/dokimi/research/records/experiment/X050.md b/dokimi/research/records/experiment/X050.md index a9129d250..d54f5e3ae 100644 --- a/dokimi/research/records/experiment/X050.md +++ b/dokimi/research/records/experiment/X050.md @@ -19,10 +19,10 @@ SPDX-License-Identifier: Apache-2.0 Registered before the check lands. #1672 turns the check of X046 into a test with a baseline of today's 55 discrepancies on spec examples, which only shrinks. - **Window:** the 4 weeks after the PR of #1672's steps 1 and 2 merges. -- **Counted:** merged PRs that fix package code and whose title names a Markdown block: a fence, a Setext heading, indented code, a code block, an HTML comment, front matter or a heading. PRs labelled `testing-strategy` belong to the program and are not counted. +- **Counted for the rate:** merged PRs that fix package code and whose title names a Markdown block: a fence, a Setext heading, indented code, a code block, an HTML comment, front matter or a heading. PRs labelled `testing-strategy` belong to the program and are not counted. - **Baseline:** 13 such fix PRs from 2026-10-13 to 2026-12-02, out of 918 merged PRs, which is 1.4 per 100. 8 of the 13 merged since 2026-11-16. - **Test:** one-sided Poisson at the window's own count of merged PRs, p < 0.05. At the baseline's 126 merged PRs a week, the threshold is 2 fixes, against 7 expected. -- **Misses:** each counted fix in the window is read by hand. +- **Misses:** every organic fix PR in the window that changes a module of a covered reader is read by hand, whatever its title. The title match is for the rate only. The covered readers at the start are in `novelty/spans.py`, `novelty/routing.py` and `repos/l0/markdown.py`, and a reader added to the check later counts from that day. - A fix, in a reader the check covers at that time, of a code, heading or comment line read as something else is a miss. - A fix of inline structure (code spans, links, reference definitions), of the line numbers a reader reports, or of a reader the check does not cover yet is out of scope and is reported apart. - **Reported, with no threshold:** diff --git a/dokimi/research/records/finding/F034.md b/dokimi/research/records/finding/F034.md index c503b18f7..cba84f951 100644 --- a/dokimi/research/records/finding/F034.md +++ b/dokimi/research/records/finding/F034.md @@ -20,7 +20,7 @@ A fix series is not only the same bug at the next site. In 105 of 418 fix PRs mo By their titles, most of these later fixes handle the next input shape at the same lines, and a few repair what the earlier fix added. So the earlier fix was usually right for its case and too narrow for its class. -The tests of a fix do prove the fix: every one of 50 sampled fix PRs has a test that does not pass without it. A gate on that would refuse nothing. What a fix PR lacks is the other shapes of the same input, which a test of the reported case does not ask for. +The tests of a fix do depend on the fix. In 45 of 50 sampled fix PRs a test fails on an assertion without it. In 4 more the tests cannot be collected without it, since they import a name it adds, and in 1 they hang. Those 5 show a dependence on the fix, not that the tests check its behaviour. A gate that asks for a test failing on the base would refuse none of the 50. What a fix PR lacks is the other shapes of the same input, which a test of the reported case does not ask for. Feature PRs are still the larger source: 38% of the fixes change code from a feature PR, each feature PR is followed by 1.82 fixes, and a few large feature PRs were each fixed more than ten times. From adee297754a57f0917c15f92025fb7a7bcb4cbd6 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Sun, 6 Dec 2026 15:59:02 +0100 Subject: [PATCH 3/5] docs(research): F032 gives the counts behind "no class-level check" F032 said that most of the verdict bugs outside the families got only a unit test of the one site. For the 61 such bugs that is 30, under half. The record now gives the counts for both populations: 39 of the 61 have no class-level check and 30 a unit test of the one site, and among the 53 whose trigger is not contrived it is 37 and 28, as X044 has it. Signed-off-by: Anton Volkov --- dokimi/research/records/finding/F032.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dokimi/research/records/finding/F032.md b/dokimi/research/records/finding/F032.md index bd1172015..1a032d9c5 100644 --- a/dokimi/research/records/finding/F032.md +++ b/dokimi/research/records/finding/F032.md @@ -20,7 +20,7 @@ The fix families with the most PRs are mostly crashes and messages on odd input. A count of fix PRs per family therefore ranks checks by how many PRs they save, not by what the bugs could do to a result. Sweeps for sibling sites found 36% of the sampled bugs, so the count also follows how hard a family is being searched. -For most of the verdict bugs outside the families the classification named only a unit test of the one site. Some of them still share a class that the keyword families do not name, such as a hand-written reader of a standard format (F033). +For 39 of the 61 verdict bugs outside the families the classification named no class-level check, and for 30 of them a unit test of the one site. Among the 53 whose trigger is not contrived it is 37 and 28. Some of them still share a class that the keyword families do not name, such as a hand-written reader of a standard format (F033). The labels are one model's reading of PR and issue text, with no second rater on this sample. From 3aee30b320af1be7d52103ff261bbde0662ef781 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Sun, 6 Dec 2026 16:43:40 +0100 Subject: [PATCH 4/5] docs(research): X046 and X050 on our own construct set, which the test of #1672 uses The CommonMark spec examples are published under CC BY-SA 4.0, so the test of #1672 takes its inputs from a set of block constructs that we enumerate ourselves: 557 documents from 35 kinds of block in 6 containers, at 1 to 3 spaces of indentation, and in pairs. X046 gets the replay on that set. With it and the repository's Markdown files the check flags the same 4 of 5 fixes as with the spec examples. The record says that this replay is not a blind one, what the spec examples have that our set lacks, and what our set reports on main (319 discrepancies in 37 groups). X050 names the inputs and the baseline of 319 discrepancies, and plans a decision for each of the 37 groups. F033 notes that our own set flagged the same fixes as the format's examples. Signed-off-by: Anton Volkov --- dokimi/research/records/experiment/X046.md | 22 +++++++++++++++++++++- dokimi/research/records/experiment/X050.md | 6 +++--- dokimi/research/records/finding/F033.md | 2 +- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/dokimi/research/records/experiment/X046.md b/dokimi/research/records/experiment/X046.md index cb1f522bf..877a2ea4e 100644 --- a/dokimi/research/records/experiment/X046.md +++ b/dokimi/research/records/experiment/X046.md @@ -48,5 +48,25 @@ SPDX-License-Identifier: Apache-2.0 The check covers 3 of the 13 modules and 5 fixes. +## Our own construct set +The spec examples are published under CC BY-SA 4.0, so the test of #1672 uses inputs of our own. The replay was run again on them. + +- **The set:** 557 documents enumerated from 35 kinds of block, each in 6 containers (top level, a block quote, a bullet and an ordered list item, a list item after a paragraph, a quote in a list item) and at 1 to 3 spaces of indentation, plus every ordered pair of 11 representative blocks, with and without a blank line between. With it went the 102 Markdown files of dokimi's `docs/` and `data/`. +- **It was written after the fixes and the results on the spec examples were known,** so this replay is not a blind one. + +| Fix | Discrepancies the fix removed, spec examples | Our set | Flagged with our set and the repository's files | +|---|---:|---:|---| +| #168 | 0 | 0 | yes, by one line of a repository file | +| #1049 | 6 | 10 | yes | +| #1045 | 81 | 345 | yes | +| #1325 | 9 | 32 | yes | +| #705 | 0 | 0 | no | + +- **With either set and the repository's files, the check flags 4 of the 5.** Without any constructed inputs, on the repository's files alone, it flags 2 (#168 and #1045). +- **`main` (19e52226) on our set:** 319 discrepancies, 168 in `segment`, 69 in `split` and 82 in `headings_as_queries`, in 37 groups by kind and place. The set is a grid, so one difference repeats across containers. +- **What the spec examples have and our set lacks,** at least 7 of their 55 rows: a fence left open that its block quote ends, fence lines indented 4 spaces, indented code measured from a wide list marker, and text after a fence inside a list item. +- **What our set reports and the spec examples do not:** HTML comments inside block quotes and list items read as prose (20 rows), and ATX headings indented 1 to 3 spaces not offered as queries. +- **Both November fixes added discrepancies that are still on `main`:** after #1045, an HTML block or a link reference definition right before a Setext heading is read as part of the heading (12 rows); after #1325, a `#` line inside a fence in a list item is read as a heading (4 rows). + ## Evidence -- local run: 878 documents through three readers, on 15 trees +- local run: 878 documents through three readers, on 15 trees; then 658 documents, our set and the repository's files, on the same trees diff --git a/dokimi/research/records/experiment/X050.md b/dokimi/research/records/experiment/X050.md index d54f5e3ae..bc2f58a9d 100644 --- a/dokimi/research/records/experiment/X050.md +++ b/dokimi/research/records/experiment/X050.md @@ -16,7 +16,7 @@ Copyright (C) 2026 Intel Corporation SPDX-License-Identifier: Apache-2.0 --> ## Setup -Registered before the check lands. #1672 turns the check of X046 into a test with a baseline of today's 55 discrepancies on spec examples, which only shrinks. +Registered before the check lands. #1672 turns the check of X046 into a test on our own set of block constructs and the repository's Markdown files, with a baseline of today's 319 discrepancies, which only shrinks. - **Window:** the 4 weeks after the PR of #1672's steps 1 and 2 merges. - **Counted for the rate:** merged PRs that fix package code and whose title names a Markdown block: a fence, a Setext heading, indented code, a code block, an HTML comment, front matter or a heading. PRs labelled `testing-strategy` belong to the program and are not counted. @@ -27,10 +27,10 @@ Registered before the check lands. #1672 turns the check of X046 into a test wit - A fix of inline structure (code spans, links, reference definitions), of the line numbers a reader reports, or of a reader the check does not cover yet is out of scope and is reported apart. - **Reported, with no threshold:** - the PRs where the test failed and the merged head passes it, a lower bound, since `make ci-local` runs the tests before the push; - - rows added to the baseline, each of them a waiver, and the rows left without a decision. #1672 plans a decision for every row within the window: fixed, or kept with its reason. That is a plan, not part of the hypothesis; + - rows added to the baseline, each of them a waiver, and the groups of rows left without a decision. #1672 plans a decision for each of the 37 groups within the window: fixed, or kept with its reason. That is a plan, not part of the hypothesis; - the test's run time, and the number of modules with their own fence regex, 13 today. -If the spec examples cannot be vendored as a fixture (#1672, open question), the test gets other inputs, and X046's replay is rerun on them before this window starts. +The inputs are our own set and not the spec examples, which are published under CC BY-SA 4.0. X046's replay was rerun on our set: it flags the same 4 of 5 fixes, though that replay is not a blind one. ## Prediction - **Supported:** no miss, and the rate is significantly below the baseline. diff --git a/dokimi/research/records/finding/F033.md b/dokimi/research/records/finding/F033.md index 9f08a59c1..f82e68976 100644 --- a/dokimi/research/records/finding/F033.md +++ b/dokimi/research/records/finding/F033.md @@ -17,7 +17,7 @@ Copyright (C) 2026 Intel Corporation SPDX-License-Identifier: Apache-2.0 --> ## Statement -A reader that dokimi writes by hand for a standard format can be tested against a parser of that format, on the format's own examples and on real files. For Markdown the check is small and was not tuned to the fixes. It flagged 4 of 5 past fixes of three readers at their parents. On a snapshot of 2026-10-20 it reported, on real files, the two problems that a real run found a month later. It also showed that one of the fixes brought in new differences from the format, most of which are still there. +A reader that dokimi writes by hand for a standard format can be tested against a parser of that format, on the format's own examples and on real files. A set of constructs that we enumerate ourselves flagged the same fixes as the format's examples, which matters where those cannot be vendored. For Markdown the check is small and was not tuned to the fixes. It flagged 4 of 5 past fixes of three readers at their parents. On a snapshot of 2026-10-20 it reported, on real files, the two problems that a real run found a month later. It also showed that one of the fixes brought in new differences from the format, most of which are still there. The classification of the fix history had put those fixes down as needing a unit test of the one site. The class appears only when the reader is compared with the format, not with its own earlier output. From 151d5044c68d04398fa7adf3c9b0659976424bd1 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Sun, 6 Dec 2026 17:30:35 +0100 Subject: [PATCH 5/5] docs(research): X049 and F034 match a blamed commit to its PR by sha, not by the number in its subject The per-PR figures of X049 matched each blamed commit to a PR by the `(#N)` at the end of its subject. Commits older than 2026-10-13 carry numbers of an earlier numbering, which collide with the PRs of the window, so 190 of 616 links went to a PR that did not write the lines. Matched by the commit's sha: 0.48 later fixes per fix PR and 1.56 per feature PR (were 0.74 and 1.82), 33% of the fix PRs fixed later (was 38%), 1.67 against 1.31 later fixes per 1,000 added lines (were 2.55 and 1.52), and 61 commits with 334 of the 633 links (were 60 PRs with 365 of 635). The four most fixed are feature commits merged before the window, so the record names them by what they added, not by a number. X049 also gives the figures within 14 days of the merge (0.37 and 0.74), which do not grow with the time observed. The shares by kind of origin, the three periods and the ages were computed from commit dates and are unchanged, and the outcome stays `refuted`. Signed-off-by: Anton Volkov --- dokimi/research/records/experiment/X049.md | 10 +++++----- dokimi/research/records/finding/F034.md | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dokimi/research/records/experiment/X049.md b/dokimi/research/records/experiment/X049.md index 37221698c..713636780 100644 --- a/dokimi/research/records/experiment/X049.md +++ b/dokimi/research/records/experiment/X049.md @@ -16,8 +16,8 @@ SPDX-License-Identifier: Apache-2.0 --> ## Setup - **Fix PRs:** the 420 that touch the package and merged from 2026-10-13 to 2026-12-02. -- **Origin:** the package lines a fix PR's squash commit deletes or rewrites are blamed at its parent (`git blame -w -M -C`), blank and comment lines left out, and each blamed commit is mapped to its PR. A fix that only adds lines is blamed on the lines around each added hunk (9 PRs). 418 PRs have blamed lines. -- **Later fixes of a PR:** a later fix PR counts for a PR when a fifth or more of its fixed lines come from that PR. Rates per PR are over the PRs merged by 2026-11-18, so that each had two weeks to draw a fix. +- **Origin:** the package lines a fix PR's squash commit deletes or rewrites are blamed at its parent (`git blame -w -M -C`), blank and comment lines left out, and each blamed commit is matched by its sha to the merge commit of a PR. A fix that only adds lines is blamed on the lines around each added hunk (9 PRs). 418 PRs have blamed lines. +- **Later fixes of a PR:** a later fix PR counts for a PR when a fifth or more of its fixed lines come from that PR. Rates per PR are over the PRs merged by 2026-11-18, so that each had two weeks to draw a fix. They count the later fixes until 2026-12-02 and, apart, those within 14 days of the PR's merge. - **The hypothesis states the picture behind item 2 of #1595.** Its threshold of a tenth was set with this analysis, not before it. ## Result @@ -30,12 +30,12 @@ SPDX-License-Identifier: Apache-2.0 - **A quarter of the fixes change code that an earlier fix wrote,** and the share rose over three periods: 11%, 26%, 29%. - **Code a fix wrote is fixed again after a median of 4 days.** For code from a feature PR it is 14.5 days. Over all origins since 2026-10-13 the median is 10 days, and 41% are fixed within a week. -- **Each fix PR is followed by 0.74 fix PRs that change its lines,** and each feature PR by 1.82. 38% of the fix PRs and 63% of the feature PRs are fixed later. Per 1,000 added lines a fix PR draws 2.55 later fixes and a feature PR 1.52. +- **Each fix PR is followed by 0.48 fix PRs that change its lines,** and each feature PR by 1.56. Within 14 days of the merge it is 0.37 and 0.74. 33% of the fix PRs and 63% of the feature PRs are fixed later. Per 1,000 added lines a fix PR draws 1.67 later fixes and a feature PR 1.31. - **By family,** of the fixes whose title matches it: budget stops and partial results 52% from an earlier fix, encoding 38%, exit codes 22%, regexes 20%. -- **60 PRs were each fixed by 3 or more later fixes,** and they hold 365 of the 635 links. The top ones are large feature PRs: #25 with 20 later fixes, #82 and #68 with 17 each, #31 with 13. +- **61 commits were each fixed by 3 or more later fixes,** and they hold 334 of the 633 links. The top four are large feature commits merged from 2026-10-02 to 2026-10-13, before the window: the novelty engine and the repository runner with 17 later fixes each, the L0 scan with 13, the repository manifest with 11. Of the PRs merged in the window, 36 were fixed 3 or more times, and the most is 9 (#155). - **In 26 pairs read by their titles,** most later fixes handle the next input shape at the same lines (#761 then #796, #189 then #233, #1227 then #1259). A few repair what the earlier fix added (#419 then #541, #454 then #743). A later fix that rewrites a line does not prove that the line was wrong, so "fixed again" is an upper bound on regressions. Blame follows a moved line only within one commit. ## Evidence -- local run: 420 squash commits blamed at their parents, 635 links from a fix to an origin PR +- local run: 420 squash commits blamed at their parents, 633 links from a fix to an origin commit, 411 of them to a PR merged in the window diff --git a/dokimi/research/records/finding/F034.md b/dokimi/research/records/finding/F034.md index cba84f951..8fa156e24 100644 --- a/dokimi/research/records/finding/F034.md +++ b/dokimi/research/records/finding/F034.md @@ -16,13 +16,13 @@ Copyright (C) 2026 Intel Corporation SPDX-License-Identifier: Apache-2.0 --> ## Statement -A fix series is not only the same bug at the next site. In 105 of 418 fix PRs most of the fixed lines were written by an earlier fix PR, and that share rose from 11% to 29% over seven weeks. Code that a fix wrote is fixed again after a median of 4 days, against 14.5 days for code from a feature PR. Each fix PR is followed by 0.74 fix PRs that change its lines, and per added line a fix PR draws more later fixes than a feature PR does. +A fix series is not only the same bug at the next site. In 105 of 418 fix PRs most of the fixed lines were written by an earlier fix PR, and that share rose from 11% to 29% over seven weeks. Code that a fix wrote is fixed again after a median of 4 days, against 14.5 days for code from a feature PR. Each fix PR is followed by 0.48 fix PRs that change its lines, 0.37 of them within 14 days of its merge, and per added line a fix PR draws more later fixes than a feature PR does. By their titles, most of these later fixes handle the next input shape at the same lines, and a few repair what the earlier fix added. So the earlier fix was usually right for its case and too narrow for its class. The tests of a fix do depend on the fix. In 45 of 50 sampled fix PRs a test fails on an assertion without it. In 4 more the tests cannot be collected without it, since they import a name it adds, and in 1 they hang. Those 5 show a dependence on the fix, not that the tests check its behaviour. A gate that asks for a test failing on the base would refuse none of the 50. What a fix PR lacks is the other shapes of the same input, which a test of the reported case does not ask for. -Feature PRs are still the larger source: 38% of the fixes change code from a feature PR, each feature PR is followed by 1.82 fixes, and a few large feature PRs were each fixed more than ten times. +Feature PRs are still the larger source: 38% of the fixes change code from a feature PR, each feature PR is followed by 1.56 fixes, and four large feature PRs merged just before the window were each fixed more than ten times. A later fix that rewrites a line does not prove that the line was wrong, so these shares are an upper bound on regressions.