You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The internal assembler now correctly performs B-type branch relaxation, but most parser, layout, encoding, and machine-CFG failures still construct CompileError with Span::default().
As a result, a malformed or unsupported generated assembly operation can still surface as line 0, even when the assembler knows the input line, operation index, section, label, and byte offset. This was a secondary finding in #1 and remains unresolved after the primary branch-range bug was fixed.
Current evidence
The assembler parses source lines but stores plain AsmOp values without their originating line number:
printf'{"status":"not-generated","reason":"test suite did not reach backend shape report generation"}\n'>"$CELLSCRIPT_BACKEND_SHAPE_REPORT"
cargo_fmt_workspace --check
check_canonical_cellscript_format
check_example_u64_boundaries
run cargo test --locked -p cellscript -- --test-threads=1
run cargo test --locked -p cellscript-artifact-checker -- --test-threads=1
check_artifact_checker_dependency_boundary
run cargo test --locked -p cellscript-fiber-adapter -- --test-threads=1
run cargo test --locked -p cellscript-ckb-adapter -- --test-threads=1
run cargo test --locked -p cellscript-wasm --features wasm -- --test-threads=1
run cargo test --locked -p cellscript-ckb-sdk-builder-example -- --test-threads=1
run cargo test --locked -p cellscript-tools -- --test-threads=1
run_executable_package_scenarios all
Required diagnostic contract
Preserve at least this provenance for each parsed operation:
generated assembly line number;
text/rodata section;
operation index and byte offset after layout;
instruction/directive text or a bounded normalized representation;
target label and resolved displacement for branch/jump failures.
Generated-assembly provenance must not be mislabeled as a CellScript source span. Where codegen has a real source/lowering-map origin, diagnostics may additionally attach it through an explicitly separate field.
All failures caused by user/compiler-produced assembly must remain ordinary stable diagnostics. No parser, layout, or encoding path should panic.
Acceptance criteria
Parsed assembly operations retain their original generated line number.
Parse, symbol, layout, branch/jump, immediate, register, directive, and encoding errors report the relevant assembly line.
Machine-CFG errors identify the involved label/block/operation without pretending to have a CellScript source span.
Human diagnostics no longer print an unexplained line 0 for an operation with known provenance.
Machine JSON distinguishes source provenance from generated-assembly provenance.
Summary
The internal assembler now correctly performs B-type branch relaxation, but most parser, layout, encoding, and machine-CFG failures still construct CompileError with Span::default().
As a result, a malformed or unsupported generated assembly operation can still surface as line 0, even when the assembler knows the input line, operation index, section, label, and byte offset. This was a secondary finding in #1 and remains unresolved after the primary branch-range bug was fixed.
Current evidence
CellScript/src/codegen/assembler.rs
Lines 340 to 404 in 8ae6dc4
CellScript/src/codegen/assembler.rs
Lines 2112 to 2131 in 8ae6dc4
CellScript/scripts/cellscript_gate.sh
Lines 580 to 595 in 8ae6dc4
Required diagnostic contract
Preserve at least this provenance for each parsed operation:
Generated-assembly provenance must not be mislabeled as a CellScript source span. Where codegen has a real source/lowering-map origin, diagnostics may additionally attach it through an explicitly separate field.
All failures caused by user/compiler-produced assembly must remain ordinary stable diagnostics. No parser, layout, or encoding path should panic.
Acceptance criteria
Non-goals