Opcode facts in one X-macro table; retire the three opcode-comment gates (#1275)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 28/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 領域
- compilers, testing-qa
調査の方向性
Start by reading src/vm.h, src/chunk.c, and the three gate scripts: tools/obs_marker_check.sh, tools/obs_reader_sync_check.sh, and tools/vm_operand_width_check.sh. Trace the opcode enum, observer lookup, and verifier role table before assessing the X-macro design. Done means the generated facts replace the duplicated checks, bytecode remains identical, and the full suite, ASan, JIT checks, and calibration plant pass.
索引モデルが issue の本文から書いたものです。
説明
Split out of #1275 (item 7, "the rest"), as its definition of done requires for rows that need a product-code change.
Problem
Three gate scripts check hand-written opcode comments against the C (1,277 lines together at 94c4c5b). None has a recorded catch of a product bug:
tools/obs_marker_check.sh(550): every opcode insrc/vm.hhas an/*obs:READS|NONE|…*/marker (#972).tools/obs_reader_sync_check.sh(448): those markers agree with thecase OP_…:arms ofopcode_is_observer_reader()insrc/chunk.c(#915/#972).tools/vm_operand_width_check.sh(279): the[kind:N]operand-width comments insrc/vm.hagree with the VM's decoder sites and chunk.c'sVR_*verifier table (#958).
Each property lives in two or three homes: a comment, a switch and a table. The scripts only exist to keep those homes in step.
Proposal (structural, principle 5)
One X-macro opcode table, for example src/opcodes.def, with one row per opcode carrying NAME, observer-class, operand roles/widths. The rest is generated from it by the preprocessor:
- the
enumin vm.h; opcode_is_observer_reader()(a lookup of the observer-class column);- the verifier's role table.
The per-opcode facts then have one home. The compiler enforces the agreement that the three scripts check today, and they are deleted. What remains is at most a small check that the decoder's read_uN widths match the table's widths (the one fact the preprocessor cannot tie). Measure whether it is needed before keeping it.
Touches the opcode ABI (see the eigenscript-extend-vm skill and the operand-width-is-ABI note): the bytecode and the JIT must be byte-identical before and after.
Done when
- Opcode name, observer class and operand roles/widths are declared in exactly one table;
enum,opcode_is_observer_reader()and the verifier roles are generated from it. -
tools/obs_marker_check.sh,tools/obs_reader_sync_check.shandtools/vm_operand_width_check.share deleted along with their suite sections andtools/selftests.txtrows, or one survivor is ≤ 150 lines and the PR shows why it is needed. - The compiled bytecode is byte-identical before and after on the corpus:
--dump, or a hash of every compiledtests/*.eigschunk, compared old against new. - Full suite, ASan-with-leaks and
tools/jit_diff.share green;make jit-smokepasses. - One calibration plant: flipping one opcode's observer class in the table changes
opcode_is_observer_reader()and makes the suite's observer section fail. The result is recorded in the PR.
- 主要言語
- C
- スター
- 3
- フォーク
- 7
- 平均マージ
- 4時間 7分
- マージ済み PR(30日)
- 112
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
InauguralSystems/EigenScript のほかの issue
-
area:embed kind:silent-wrong
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
InauguralSystems/EigenScript#1387 ·
メンテナーはふだん 1 日以内に返信
-
area:stdlib kind:silent-wrong
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
InauguralSystems/EigenScript#1378 ·
メンテナーはふだん 1 日以内に返信
-
area:gates kind:gate-defect
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
InauguralSystems/EigenScript#1374 ·
メンテナーはふだん 1 日以内に返信
-
Error carets pad multi-byte UTF-8 byte-for-byte, so the ^ lands right of the token on a terminalオープンarea:lint-tooling kind:silent-wrong
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
InauguralSystems/EigenScript#1373 ·
メンテナーはふだん 1 日以内に返信
-
area:gates kind:docs-drift
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
InauguralSystems/EigenScript#1372 ·
メンテナーはふだん 1 日以内に返信
InauguralSystems/EigenScript の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
BasedHardware/omi#19711 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
microsoft/ebpf-for-windows#5604 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
trezor/trezor-firmware#7985 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信