Skip to content

DOOM study: lineage.py, name/body survival vs linuxdoom on licensed ports (Part of #5620) - #5714

Merged
squid-protocol merged 1 commit into
mainfrom
churn/5620-20261020T0844Z
Oct 20, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
churn/5620-20261020T0844Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #5620 (slice 1 of 4).

What

tests/tools/doom_speedrun/lineage.py ports round-1 survival.py and canonical.py into the speedrun harness as our own tool. It reads the clones and scans that doom_speedrun.py already produces (<work>/repos, <work>/scans/<sha>) and writes to <work>/results/<sha>/lineage/.

  • Survival vs linuxdoom-1.10: for each baseline function with at least 20 body tokens, check whether a port keeps the name, an exact body (C comments and whitespace ignored), a near body (difflib ≥ 0.9) or a derived body (≥ 0.6). Reported per port, per subsystem (by linuxdoom file prefix) and per function, plus file-stem survival.
  • Stated parent: the manifest port named by the opening words of the lineage text, never the port itself. exact_vs_parent is the change in exact bodies against that parent.
  • Divergence: name, body and core-subsystem overlap matrices, with vendored code skipped via the engine's VendorDirectoryDetector.
  • Landmarks: 12 canonical functions per port (where each one is found, its LOC and complexity).
  • Licensed ports only: --only refuses anything outside callgraph_oracle.LICENSED plus the licensed non-C ports.

Check against round 1 (engine 0e2bf4ade, 662 baseline functions)

port name % exact % round 1
chocolate-doom 86.7 34.9 86.6 / 35.1
crispy-doom (parent chocolate-doom) 86.7 21.0
doomretro (parent chocolate-doom) 69.0 0.2
dsda-doom (parent prboom-plus) 72.2 3.2

Class sweep

Class: the round-1 DOOM study scripts that still live outside the repo.

  • survival.py, canonical.py: this PR
  • metrics.py, clean_check: already covered by the harness (doom_scorer.py)
  • determinism, hotspots_extra: sibling gap
  • study-prototype callcheck*, consensus*: sibling gap (callgraph_oracle.py covers part of this)

Remaining slices (in order)

  1. tests/tools/doom_speedrun/distribution.py + test: port study-prototype dist.py (distribution module).
  2. tests/tools/doom_speedrun/callmaps.py + test: the call-graph subway map (per-port graph metrics, subsystem call matrix, layout-free check).
  3. A fidelity column in the manifest holding each port's stated fidelity from its README, plus a test update.
  4. Later: a current-main rescan, the write-up (docs/research/doom-port-study.md).

Gates

  • tests/tools/test_doom_lineage.py: 18 passed, both python -m pytest and plain pytest from /tmp
  • test_source_reads: passes (sources read through read_source)
  • ruff / dead-key audits --ci: no new findings. mypy --ci: 3 new findings, all in cobol_to_java (not this PR's files)
  • ruff format: clean
  • tests/tools/: test_pin_requirements_check_all fails locally because it resolves the lockfiles against live PyPI; unrelated to this PR

🤖 Generated with Claude Code

…orts (Part of #5620)

Ports round-1 survival.py / canonical.py into the speedrun harness as our own tool:
per-function name and body survival (exact / near / derived), per-subsystem and
file-stem survival, the stated parent from the manifest lineage with exact-vs-parent,
name/body divergence matrices skipping vendored code, and 12 landmark functions.
Refuses any port outside the licensed set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 20, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

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

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant