Keep source-remapped diagnostics within proven original spans
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C++
- スター
- 0
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CrossGL/compiler のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
Track CrossTL project-porting report and source-remap compatibility再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
CrossGL/compiler の issue をすべて見る
似ている issue
-
Jupyter kernel leaks two file descriptors per cell; after ~100 cells every cell fails with "pipe() failed"対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Test discovery aborts on GPU builds without cuStateVec: check_cuStateVec expects a failed result but set_config() now raises RuntimeError対応中かも @dmeliksetian が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Qiskit/qiskit-aer#2495 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
sumatrapdfreader/sumatrapdf#6403 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
Jumballaya/Journeyman-Engine#199 ·
メンテナーはふだん 1 日以内に返信
-
backend enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信