Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions dokimi/research/records/experiment/X044.md
Original file line number Diff line number Diff line change
@@ -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
---
<!--
Copyright (C) 2026 Intel Corporation
SPDX-License-Identifier: Apache-2.0
-->
## 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. 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, 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.

## Evidence
- local run: the 225 classified fix PRs recounted by family, trigger, impact and finder
36 changes: 36 additions & 0 deletions dokimi/research/records/experiment/X045.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
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
---
<!--
Copyright (C) 2026 Intel Corporation
SPDX-License-Identifier: Apache-2.0
-->
## 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.
- 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.

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
72 changes: 72 additions & 0 deletions dokimi/research/records/experiment/X046.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
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
---
<!--
Copyright (C) 2026 Intel Corporation
SPDX-License-Identifier: Apache-2.0
-->
## 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.

## 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; then 658 documents, our set and the repository's files, on the same trees
39 changes: 39 additions & 0 deletions dokimi/research/records/experiment/X047.md
Original file line number Diff line number Diff line change
@@ -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
---
<!--
Copyright (C) 2026 Intel Corporation
SPDX-License-Identifier: Apache-2.0
-->
## 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
29 changes: 29 additions & 0 deletions dokimi/research/records/experiment/X048.md
Original file line number Diff line number Diff line change
@@ -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
---
<!--
Copyright (C) 2026 Intel Corporation
SPDX-License-Identifier: Apache-2.0
-->
## 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 <<EOF; echo hi` followed by a one-line body, and gives a heredoc body three lines too long. bash runs it as expected: the body is one line and `echo hi` is a command. It also reports a parse error on two heredocs on one line.
- **bashlex** raises on a quoted delimiter (`<<'EOF'`) and on `case`.
- **Neither is a reference.** Each fails on forms that the fixes of the shell readers are about.
- **Bash itself is the only reference.** Using it means tracing which lines it runs as commands, on scripts that a generator builds from harmless commands, since the text of real files must not be executed. That is a known-answer generator, not a differential on real text, and it was not built.

## Evidence
- local run: ten snippets through two parsers, one of them through bash
41 changes: 41 additions & 0 deletions dokimi/research/records/experiment/X049.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
id: X049
type: experiment
title: Which PRs wrote the code that fix PRs change
date: '2026-12-06'
idea: I018
hypothesis: A fix series is the same bug at the next site, so a fix PR seldom changes lines that an earlier fix PR wrote, in under a tenth of the fix PRs.
outcome: refuted
links:
- https://github.com/intel/dokimi/issues/1595
- https://github.com/intel/dokimi/issues/1595#issuecomment-7457688120
---
<!--
Copyright (C) 2026 Intel Corporation
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 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
| 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.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%.
- **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, 633 links from a fix to an origin commit, 411 of them to a PR merged in the window
Loading
Loading