Skip to content

structural-fingerprint-scanner: fingerprints, calibrated function twins, descent and profile trees - #15

Merged
squid-protocol merged 1 commit into
mainfrom
structural-fingerprint-scanner
Oct 21, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
structural-fingerprint-scanner

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

What

structural-fingerprint-scanner/ packages the DNA-profiler idea (twin_discovery*.py, mine_dna_stoichiometry.py) as a tested tool, sfs, that reads GitGalaxy scan databases and produces:

  • fingerprints in the engine's own 37-D function reference frame (population scaler, rosetta weights, caps and the k=14 archetype centroids, vendored with engine provenance). Recomputed archetypes match the engine's stored labels for 100% of functions on real scans.
  • profile distance between repositories (archetype mix, signal densities, geometry, centroid, call-graph shape), plus sfs explain
  • name-blind function twins: reciprocal best hits, a ratio test, a target–decoy FDR threshold (archetype-stratified decoys, +1 corrected) and exact structural clones
  • descent (Wilson-bounded shared structure), UPGMA profile and descent trees, and a declared-lineage check
  • a portable lens with weights derived from keyword-rosetta's cross-language consistency
  • reports in Markdown, HTML (heatmaps with trees, light and dark), CSV, JSON and Newick

Dependencies: NumPy and SciPy only. Python 3.10+.

Validation (44 licensed DOOM ports, engine 9f213ab83)

  • 87.7% of 88,036 twins join same-named functions, although names are never used to match (94–99.8% in high-survival pairs)
  • linuxdoom survives 54–57% in the minimal ports, 34% in Chocolate and 19% in Crispy, tracking an earlier source-text study (35.1% / 21.1%)
  • descent tree: the nearest neighbour is declared family for 74% of the 23 ports with detectable descent; the misses include Eternity adopting Chocolate's textscreen library (code shared sideways) and a doomgeneric lineage that the manifest had only inferred

Details: structural-fingerprint-scanner/examples/doom/README.md; method: docs/METHOD.md.

Tests

34 tests on synthetic scan DBs plus a real-scan parity test (SFS_REAL_SCANS=...). All pass locally; ruff is clean. No CI is added, so this repo's runs don't compete with gitgalaxy's.

Also moves the superseded scripts to archive/ and links the tool from the root README.

🤖 Generated with Claude Code

…ins, descent and profile trees

Packages the DNA-profiler idea as a tool that reads GitGalaxy scan databases:
- function vectors in the engine's own 37-D reference frame (vendored population
  scaler, weights, caps and k=14 centroids, with engine provenance); recomputed
  archetypes match the engine's stored labels exactly
- repository fingerprint: archetype mix, signal densities, geometry sketches,
  LOC-weighted centroid, call-graph shape; spec hash guards comparability
- profile distance (cohort-normalized components) and explain
- name-blind function twins: reciprocal best hits + ratio test + target-decoy
  FDR (archetype-stratified decoys, +1 corrected) + exact clones; survival and
  Wilson-bounded shared structure
- UPGMA profile and descent trees (Newick), declared-lineage check
- portable lens derived from keyword-rosetta cross-language consistency
- Markdown/HTML/CSV/JSON reports, sfs CLI, 34 tests incl. real-scan parity
- validation on 44 licensed DOOM ports (examples/doom)

Moves twin_discovery*.py and mine_dna_stoichiometry.py to archive/.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.

1 participant