bug: text codegen-unit path (into_codegen_unit_texts) drops available_externally copies: "use of undefined value" with PERRY_CODEGEN_UNITS + PERRY_LLVM_INPROCESS
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust, typescript
調査の方向性
crates/perry-codegen/src/module.rsを読み、特に1316行目あたりのLlModule::into_codegen_unit_textsを確認し、1895行目あたりにあるもう一方のユニットパートレンダラーと比較してください。module/inline_copies.rsでpart.copiesがどのように設定されるかを確認してください。再現手順とコマンドはissueにあります。テキストレンダラーにavailable_externallyのコピーが含まれ、in-process LLVMパスで再現ケースがコンパイルできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
With split codegen units on the text unit path, a module whose functions call each other fails to compile. The text path is used when native units are off: PERRY_LLVM_INPROCESS=1, --debug-symbols, and fallback diagnostics. The error is:
perry_llvm_<hash>.ll:562:21: error: use of undefined value '@perry_checked_number_remainder'
Cause (from the code at 86988bec62): LlModule::into_codegen_unit_texts (crates/perry-codegen/src/module.rs, around line 1316) renders only part.pre, part.funcs and part.post. It drops part.copies, the available_externally cross-unit inline copies (module/inline_copies.rs). Those copies are counted as defined in their unit (defined.extend(copies...), around line 1756), so no declare is emitted for them either, and the callee is undefined in the unit's IR. The other renderer of unit parts, around line 1895, does emit part.copies. Expected: into_codegen_unit_texts renders part.copies the same way.
Reproduction
split_unit_copies.ts:
function r0(a: number, b: number) { return (a * 3 + b) % 7; }
function r1(a: number, b: number) { return (a * 4 + b) % 9; }
function r2(a: number, b: number) { return (a * 5 + b) % 11; }
function r3(a: number, b: number) { return (a * 6 + b) % 13; }
function r4(a: number, b: number) { return (a * 7 + b) % 15; }
function r5(a: number, b: number) { return (a * 8 + b) % 17; }
function r6(a: number, b: number) { return (a * 9 + b) % 19; }
function r7(a: number, b: number) { return (a * 10 + b) % 21; }
const fns = [r0, r1, r2, r3, r4, r5, r6, r7];
let t = 0;
for (let i = 0; i < 8; i++) for (let j = 1; j < 20; j++) t += fns[i](i * 7 + j, j);
console.log(t);
PERRY_CODEGEN_UNITS=4 PERRY_LLVM_INPROCESS=1 perry compile split_unit_copies.ts --no-link -o b.o # fails as above
PERRY_CODEGEN_UNITS=4 perry compile split_unit_copies.ts -o b && ./b # native units: prints 986
node split_unit_copies.ts # 986
Environment
- PerryTS/perry main 86988bec62 (pristine, current head), and 08c74942f1. Linux host build (
cargo build --release -p perry --no-default-features --features dev-cliplus the runtime/stdlib static archives). - Linux x86_64, 32 threads, Ubuntu 24.04.
- 主要言語
- Rust
- スター
- 4.9k
- フォーク
- 166
- 平均マージ
- 4時間 54分
- マージ済み PR(30日)
- 909
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PerryTS/perry のほかの issue
-
area:compiler effort:S impact:med platform:windows type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
area:runtime-gc effort:S impact:low platform:linux type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
PerryTS/perry#14789 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
area:compiler effort:S impact:med type:bug
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
メンテナーはふだん 1 日以内に返信
-
area:runtime-gc effort:L impact:med type:perf
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
<input type="number"> misses text-entry leaf sizing in layout対応中かも @GoCoder7 が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
DioxusLabs/blitz#1675 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
metasequoiaime/msime#11666 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
camunda/orchestration-cluster-api-rust#179 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
bug drawings help wanted ui
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
userFRM/egui-charts#3479 ·
メンテナーはふだん 1 日以内に返信