Go encapsulation counts every lowercase symbol: 72% of a Go DOOM port lands in the encapsulation archetypes (C original 2%)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
Start with the Go encapsulation patterns in go.py and find their tests and goldens; use the supplied package main fixture to check that lowercase declarations produce no hits, then compare with a library-package case. Re-measure gore and inspect the Rust rule against the visibility question. Done means the acceptance checks pass, the archetype share is reported, and the rosetta expectations and goldens are updated with the drift explained.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Finding (DOOM study calibration, #5620)
Go's encapsulation rule counts every lowercase top-level symbol (go.py: ^func\s+(?:\([^)]*\)\s+)?[a-z]… and ^(type|var|const)\s+[a-z]…). keyword-rosetta ledgers this as intended visibility morphology (visibility-morphology-encapsulation, engine-semantic, validated 2026-08-31) and warns that "cross-language encapsulation comparisons must expect these to run structurally hot". On real translated code the effect is no longer a footnote. It decides the function archetypes the engine reports for Go.
Measurements at engine 9f213ab83, licensed DOOM ports, functions of at least 3 lines:
| port | language | functions with an encapsulation hit | hits / 100 LOC | in the two encapsulation archetypes¹ | Compute Cores |
|---|---|---|---|---|---|
| linuxdoom (original) | C | 5% | 0.21 | 1.9% | 34.3% |
| doom-scheme (translation) | Scheme | n/a | n/a | 1.5% | 34.2% |
| gore (translation) | Go | 94% | 3.09 | 71.8% | 4.3% |
| dartdoom (translation) | Dart | 37% | 1.54 | 31.3% | 20.3% |
¹ Encapsulated Accessors + Stateful Encapsulated Methods (k=14 function model).
gore keeps linuxdoom's call wiring (77% of linuxdoom's calls survive between the corresponding functions; structural-fingerprint-scanner subway maps, population-analyses examples/doom/), so the algorithm is the same. Yet nearly three quarters of its functions, renderer and playsim included, are labelled as encapsulation archetypes. Seven of gore's nine package clauses are package main, and 950 of its 1,025 func declarations are lowercase. In a main package nothing can be imported, so a lowercase name is not a visibility decision at all. The keyword-rosetta control shows the same skew on the identical planted program: def_encapsulation C 0, Java 0, Dart 0, C++ 0, Go 3.75, Rust 3.
Fixture (our own code, not from any port):
package main
func renderColumn(x int) int { // lowercase: counted as encapsulation today
return x * 2
}
func main() {
renderColumn(3)
}
Options
- Rule: in a
package mainfile, lowercase declarations carry no visibility meaning, so don't count them. Optionally count only unexported methods and types in library packages. This is the smallest semantic fix. - Model: keep the rule, but have the function-archetype classifier down-weight
def_encapsulationfor languages ledgered under visibility morphology (go, perl, and rust if confirmed), so the archetype labels stop tracking spelling. - Leave it: document in the archetype docs that Go archetype mixes are not comparable with other languages.
Recommendation: option 1, which stays faithful to the ledger's "correct morphology" (library packages still count), then re-measure. If Go archetype mixes still diverge on translations that keep the original's wiring, do option 2 as well. Check Rust's rule against the same question (rosetta 3 vs 0).
Acceptance
- The fixture above: 0 encapsulation hits in
package main; a library-package variant still counts its unexported functions (test). - gore's encapsulation-archetype share re-measured and posted here (target: within ~10 points of the C original's, or the residual explained).
- keyword-rosetta
visibility-morphology-encapsulationupdated (Go expected counts re-locked), and goldens re-blessed with the drift explained.
Part of #5457; calibration finding for #5620. Data: structural-fingerprint-scanner per-subsystem view (gitgalaxy-population-analyses PR #19).
- Lenguaje dominante
- Python
- Estrellas
- 57
- Forks
- 11
- Merge medio
- 1 h 14 min
- PR fusionados (30 d)
- 967
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de squid-protocol/gitgalaxy
-
Siblings of #6839: COBOL -> lowered-HLASM boundary (linked coverage, START target, code page)Abiertoscope:sweep testing
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
squid-protocol/gitgalaxy#7011 ·
Los mantenedores suelen responder en 1 día
-
priority: high scope:core
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
squid-protocol/gitgalaxy#6974 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
claim:melek enhancement legacy-modernization priority: high scope:core testing
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
squid-protocol/gitgalaxy#6967 · 10 comentarios ·
Los mantenedores suelen responder en 1 día
-
enhancement legacy-modernization priority: low scope:frontier
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
squid-protocol/gitgalaxy#6926 ·
Los mantenedores suelen responder en 1 día
-
bug call-graph core-engine priority: high scope:core
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
squid-protocol/gitgalaxy#6904 ·
Los mantenedores suelen responder en 1 día
Todos los issues de squid-protocol/gitgalaxy
Issues similares
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
awslabs/visual-asset-management-system#937 ·
Los mantenedores suelen responder en 1 día
-
Admin member of a research group cannot see the HX2 allocation until they've been added to itAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
follow-up
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 83/100
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 2 días