Skip to content

docs: drop the two sections a repeated merge pasted twice, and catch the next one - #9637

Closed
noosko21-a11y wants to merge 3 commits into
ProjectLeonida:mainfrom
noosko21-a11y:cleanup/repeated-merge-text
Closed

noosko21-a11y wants to merge 3 commits into
ProjectLeonida:mainfrom
noosko21-a11y:cleanup/repeated-merge-text

Conversation

@noosko21-a11y

@noosko21-a11y noosko21-a11y commented Nov 23, 2026 •

Copy link
Copy Markdown

Claimed in the coordination issue (#9677) as: claiming: docs - the two Markdown sections a repeated merge pasted twice.

Depends on: none. Two other open pull requests cover work I had in this branch and did not keep here: #9647 (tests/test_build_batch_launch.py, the -FilePath cmd.exe launch line) and #9666 (tools/wave_diff.py, tools/leonida_tui.py, the two unpinned newline=). This pull request is scoped to the duplicated sections and the check that catches them.

What and why

Two Markdown sections were on the page twice, word for word.

  • docs/models.md 568-652 was repeated at 653-737: 85 lines - the material -> effect paragraph, the effect-record list, the record format table, and the two open questions.
  • docs/testing.md's "GPUs with 128 bytes of push constants" ran twice back to back: 18 lines.

Both are repeated-merge artifacts, the shape the coordination issue already tracks (a rebase that keeps both sides). The copies are byte-identical, so the second is deleted and nothing is lost. The ranges were compared before writing, line by line - the deletion script asserts that the kept range equals the removed range and exits without touching the file otherwise.

tests/test_docs_repeated_lines.py could not see this. It flags one sentence repeated on neighbouring lines, so a section pasted whole went through. repeated_blocks() is added next to it: a block of BLOCK (6) lines or more immediately followed by a copy of itself. It has its own unit test (a repeated block, an under-length block, a block repeated with a line between) and the scan reads tracked Markdown only.

On main it reports exactly the two sections above and nothing else:

docs/models.md:568-651 repeated at :653-736 (84 lines)
docs/testing.md:337-353 repeated at :355-371 (17 lines)

Checked by mutation, not by assertion. Re-inserting the removed 84-line block into a copy of the fixed docs/models.md makes repeated_blocks report (568, 652, 84) at the original line numbers, while repeated_lines on that same text still reports nothing. The gap this closes is the line check's, and that is measured, not assumed.

Tested

Clean worktree at the pull request head, not a working copy:

python -I tests/test_docs_repeated_lines.py  -> Ran 4 tests, OK   (main: FAIL, the two blocks above)
python -m compileall -q make_game.py tools tests -> OK

No game files, no GPU, no shader translation: Markdown plus one standard-library test. Windows 11, Python 3.12.10; nothing platform-specific in the change.

The rest of the test_docs_*.py set is unchanged by this pull request: the three that fail in this checkout fail identically on main (test_docs_links.py is an odd fence count in runtime/README.md, reported as a finding in the coordination issue; the other two read the uninitialised third_party submodule and one design.md row).

AI-assisted: yes

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. - not applicable, no translator change.

@noosko21-a11y

Copy link
Copy Markdown
Author

Claim: #8683 (comment) (two claiming: lines and two finding: lines in that comment).

No checks have run on this head yet - a fork pull request waits for a maintainer to approve CI. Locally, on this exact tree: tests/test_docs_repeated_lines.py 4 tests OK, tests/test_text_write_line_endings.py 3 tests OK, tests/test_build_batch_launch.py 2 tests OK (red on main at 5d74c27), python -m compileall -q make_game.py tools tests OK.

The '## GPUs with 128 bytes of push constants' section was on the page twice,
word for word, after a repeated merge of the same pull request. Delete the
second copy; the section, its links and its commands are unchanged.
Lines 568-652 were repeated verbatim at 653-737: the material -> effect
paragraph, the effect-record list, the record format table and the two open
questions, twice in one page. Delete the second copy. No text is lost: the
removed range was byte-identical to the range kept.
The line check catches one sentence kept twice on neighbouring lines. A repeated
merge also pastes a section whole - heading, table, code, 84 lines in
docs/models.md - which that check cannot see. repeated_blocks() reports a block of
BLOCK lines or more that is immediately followed by a copy of itself; the two
sections removed in the previous commits are what it found on main. The detector
has its own unit test (a repeated block, an under-length block, a block repeated
with a line between) and the scan reads tracked Markdown only.
@noosko21-a11y
noosko21-a11y force-pushed the cleanup/repeated-merge-text branch from 4c3d3d5 to 3d5205d Compare November 23, 2026 21:59
@noosko21-a11y noosko21-a11y changed the title docs, tests: drop the two sections a repeated merge pasted twice, and restore the build-launch check docs: drop the two sections a repeated merge pasted twice, and catch the next one Nov 23, 2026
@noosko21-a11y

Copy link
Copy Markdown
Author

Scope reduced to the duplicated sections and the check that catches them.

Dropped three commits that duplicate open work, so this does not ask anyone to reconcile two copies of the same fix:

What is left is the part nobody else has: docs/models.md (85 duplicated lines), docs/testing.md (18), and tests/test_docs_repeated_lines.py gaining repeated_blocks(), which is what would have caught them. Verified by mutation: putting the 84-line block back into a copy of the fixed file makes repeated_blocks report (568, 652, 84), while repeated_lines on the same text reports nothing.

If #9647 or #9666 stall, I can put my versions back - they were tested and green on a clean worktree at 4c3d3d5.

@catminou4

Copy link
Copy Markdown
Contributor

Tested 3d5205d on macOS 26 arm64, Python 3.12, CPU only, no game files: pass. python -I tests/test_docs_repeated_lines.py — 4 tests OK. AI-assisted (Devin).

@KoertLichtendonk

Copy link
Copy Markdown
Contributor

Coordinator note: this looks like the same change as #5483 by @liang-kai-shui (opened 11:07 UTC, still open). Please compare the two and either close this one or say here what it adds. The maintainer decides which one is merged.

@molodayamama

Copy link
Copy Markdown
Contributor

Independent Windows check on 3d5205d586cca9eb5421e0ce9f1e6efb2df7545d (CPython 3.13.5 for Python tests).

  • python -I tests/test_docs_repeated_lines.py (4 passed).

The repetition detector tests covered matching duplicate sections and avoiding reports for permitted repetitions.

Scope: local fixtures, no retail files or live GPU run. AI-assisted verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants