Keep source-remapped diagnostics within proven original spans
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Start with src/Driver/SourceRemap.cpp and trace parseSourceRemap, remapInsideEntry, and the public remapSourceLocation path. Reproduce the reported schema-1 case, then inspect how standalone remaps and report, text/JSON, and package debug outputs represent provenance. Done means the requested distinctions and bounds policy are consistent across those paths, with coverage for the listed span, newline, Unicode, synthetic, and exact-map cases.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
remapSourceLocation can return an originalLocation outside the declared original span. On dev at d43047c2a407a9bd1a90f21d1df0dd94507a698d, remapInsideEntry translates offsets and line/column deltas without checking the original bounds or mapping fidelity.
This affects repository porting generally. CrossTL emits file-level provenance when a translation does not preserve source lines. Treating that association as an affine byte mapping produces false diagnostic locations, particularly for generated helpers. The defect was found while reviewing MLX translation evidence, but the reproducer has no MLX dependency.
Reproduction
Parse this schema-1 document with parseSourceRemap:
{
"schemaVersion": 1,
"generatedFile": "generated.cgl",
"mappings": [{
"generated": {"file":"generated.cgl","line":1,"column":1,"offset":0,"length":100,"endLine":1,"endColumn":101,"endOffset":100},
"original": {"file":"original.metal","line":1,"column":1,"offset":0,"length":10,"endLine":1,"endColumn":11,"endOffset":10}
}]
}
Call remapSourceLocation with SourceLocation{"generated.cgl", 1, 81, 80, 5, 1, 86, 85}. Parsing succeeds without diagnostics. The result is original.metal, offsets 80:85, columns 81:86, even though the entire original span is 0:10, columns 1:11.
Reproduced locally with both the existing compiler library and a fresh compilation of src/Driver/SourceRemap.cpp from the stated commit linked to the library's support code. The source reducer calls the public parser and remapper directly.
Requested Contract
- Never produce a remapped diagnostic outside its original span. Preserve the generated location when correspondence is not established; clamping to the original end is not an accurate fix.
- Distinguish exact diagnostic correspondence from coarse file provenance, heuristic candidates, synthetic code and unmapped code. Specify how standalone sidecars carry that distinction, since schema 1 has no granularity field.
- Apply the same policy to standalone remaps, report metadata, text/JSON diagnostics and package debug metadata. Preserve provenance without presenting it as an exact
originalLocation. - Retain compatibility for valid exact schema-1 maps. Document behavior for legacy unequal spans rather than assuming equal span length proves semantic correspondence.
- Cover shorter original spans, multiline expansion, newline normalization, Unicode byte offsets, synthetic helpers and unchanged exact mappings.
Related tracking: #27. Translator-side defect: CrossGL/crosstl#2131. CrossTL is correcting its guessed line mappings independently; compiler release availability is not required for that correction.
- Lingua principale
- C++
- Stelle
- 0
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CrossGL/compiler
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Track CrossTL project-porting report and source-remap compatibilityForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
Tutte le issue di CrossGL/compiler
Issue simili
-
[mimalloc] update to 3.6.0Apertacategory:port-update
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 2 giorni
-
MinGW build faillureAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
facebookresearch/faiss#5775 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Eval bug: minimax-m3: build_moe_ffn() drops the per-expert NVFP4 scale → garbled output (M3.1 Flash)Apertabug-unconfirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
bug triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
secondlife/viewer#6507 ·
I maintainer di solito rispondono entro 1 giorno
-
clang:frontend code-cleanup HLSL
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
llvm/llvm-project#235100 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno