Opcode facts in one X-macro table; retire the three opcode-comment gates (#1275)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 28/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- compilers, testing-qa
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C
- Star
- 3
- Fork
- 7
- Merge trung bình
- 4 giờ 15 phút
- Pull request đã merge (30 ngày)
- 106
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của InauguralSystems/EigenScript
-
area:lint-tooling bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
InauguralSystems/EigenScript#1340 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:stdlib found-by:code-review kind:silent-wrong
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
InauguralSystems/EigenScript#1338 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:lint-tooling found-by:critic kind:docs-drift
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
InauguralSystems/EigenScript#1335 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:ci found-by:critic kind:gate-defect
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
InauguralSystems/EigenScript#1311 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enrolment: decide test_gc_runner_controls.py (exempt vs enrol) and whether floors need a ratchetĐang mởarea:gates found-by:critic kind:decision
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
InauguralSystems/EigenScript#1280 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của InauguralSystems/EigenScript
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
ARM-software/sysarch-acs#556 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
netdata/netdata#24062 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100