Skip to content

Commit a0842ad

Browse files
committed
Advance CellScript 0.17 iCKB benchmark gates
1 parent 95eb2c9 commit a0842ad

55 files changed

Lines changed: 11748 additions & 992 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Cargo.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cellscript"
3-
version = "0.16.0"
3+
version = "0.17.0"
44
edition = "2021"
55
rust-version = "1.85.0"
66
autobins = false

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ policy defaults:
558558
```toml
559559
[package]
560560
name = "token"
561-
version = "0.16.0"
561+
version = "0.17.0"
562562
entry = "src/main.cell"
563563
source_roots = ["src"]
564564

‎docs/0.17/CELLSCRIPT_0_17_ROADMAP.md‎

Lines changed: 287 additions & 25 deletions
Large diffs are not rendered by default.

‎docs/0.17/ickb_cellscript_gap_matrix.md‎

Lines changed: 52 additions & 22 deletions
Large diffs are not rendered by default.

‎docs/0.17/ickb_diff_results.md‎

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,20 @@
33
The differential harness is partial and model-level only.
44

55
`tests/benchmarks/ickb_diff/matrix.json` records the selected comparison
6-
matrix. The test `ickb_diff_matrix_is_partial_and_consistent_with_model_fixtures`
7-
checks that every row is labelled as a model result rather than CKB VM
8-
equivalence.
6+
matrix. The manifest now uses schema `cellscript-ickb-diff-matrix-v1` and is
7+
also the executable production-equivalence claim gate. The integration test
8+
`tests/ickb_diff.rs` checks that every current row is labelled as a model result
9+
rather than CKB VM equivalence, and rejects any future `PROVEN` claim that lacks
10+
binary hashes, CKB VM/testtool evidence, fixture hashes, exit codes, cycle
11+
counts, and named reject modes. The iCKB-specific gate is intentionally kept in
12+
the test suite rather than the generic `cellc` CLI.
13+
14+
Current manifest status:
15+
16+
- `mode`: `MODEL_LEVEL_ONLY`
17+
- `equivalence_status`: `NOT_PROVEN`
18+
- `production_equivalence_claim`: `false`
19+
- `equivalence_evidence`: `null`
920

1021
| Scenario | Original iCKB expected | CellScript expected | Result |
1122
|---|---:|---:|---|
@@ -19,15 +30,54 @@ equivalence.
1930
| valid limit order | pass | pass | model-pass |
2031
| limit order underpayment | fail | fail | model-pass |
2132

33+
## Production Equivalence Gate
34+
35+
The stricter gate is documented in
36+
`docs/0.17/ickb_production_equivalence_gate.md`. In short, production
37+
equivalence requires:
38+
39+
- original iCKB repo commit and script binary hashes;
40+
- CellScript source commit and generated artifact hashes;
41+
- CKB VM/testtool version;
42+
- transaction fixture manifest hash;
43+
- proof that inputs, outputs, cell deps, header deps, witnesses, and output data
44+
are identical across both executions;
45+
- original and generated exit codes;
46+
- named failure modes for rejects;
47+
- cycle and transaction-size measurements;
48+
- per-row execution objects with fixture/context hashes, both artifact hashes,
49+
status/exit-code match, cycles, transaction size, occupied capacity, and fee.
50+
51+
Without those fields, `MODEL_LEVEL_ONLY` rows cannot be upgraded to
52+
behavioural-equivalence rows.
53+
2254
## Why This Is Not Behavioural Equivalence
2355

2456
- The original iCKB Rust scripts were not executed side-by-side with generated
2557
CellScript artifacts.
2658
- iCKB `cargo test --locked` did not run to completion because prebuilt Capsule
2759
contract binaries were missing under `scripts/build/debug`.
28-
- CellScript currently lacks first-class HeaderDep, Script role, CKB OutPoint,
29-
occupied capacity, xUDT args, and DAO maturity primitives required for a true
30-
CKB VM differential test.
60+
- CellScript 0.17 has partial HeaderDep, SourceView, script-role, input
61+
OutPoint, pairwise MetaPoint relative, fixed-distance lock/type MetaPoint
62+
pair cardinality, base-cell-data signed i32 lock/type MetaPoint pair
63+
cardinality, DAO-rate/header-lineage/type-and-data-classification, and xUDT
64+
helper surfaces. Input-side accumulated-rate reads can now use `LOAD_HEADER`
65+
at the original iCKB `AR_OFFSET=160+8`. The iCKB owner-mode xUDT args pattern
66+
now has executable explicit-hash and current-script-hash Type Script args
67+
verifiers, SourceView lock/type empty-args and 32-byte args helpers exist,
68+
and simple xUDT group amount conservation plus token-side minted/burned
69+
deltas have executable helpers and strict helper-backed aggregate bridges.
70+
iCKB-specific output deposit/receipt map equality, receipt byte layout, and
71+
group receipt mint-sum recomputation are deliberately kept in benchmark
72+
fixtures instead of generic `dao::*` helpers. Local `u128`
73+
add/sub/mul/div/function-return deltas can now be materialized for generic
74+
xUDT delta helpers. CellScript also has
75+
RFC0017 epoch-since constructors and a generated relative epoch maturity
76+
bridge for DAO-like redeem paths. CellScript still lacks full arbitrary
77+
`Script`, full DAO second-withdrawal request/deposit/header binding,
78+
computed multi-cell iCKB mint-side receipt/deposit/DAO aggregate lowering,
79+
and native action-aware MetaPoint map semantics for a true CKB VM
80+
differential test.
3181

3282
## Next Differential Step
3383

‎docs/0.17/ickb_discovery.md‎

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,27 @@ git -C /tmp/cellscript-ickb-audit/proposal rev-parse HEAD
101101
git -C /tmp/cellscript-ickb-audit/v1-core rev-parse HEAD
102102
```
103103

104+
Production-equivalence revisit:
105+
106+
```bash
107+
rm -rf /tmp/cellscript-ickb-prod-eq
108+
git clone --depth 1 https://github.com/ickb/v1-core.git /tmp/cellscript-ickb-prod-eq/v1-core
109+
git clone --depth 1 https://github.com/ickb/proposal.git /tmp/cellscript-ickb-prod-eq/proposal
110+
git -C /tmp/cellscript-ickb-prod-eq/v1-core rev-parse HEAD
111+
git -C /tmp/cellscript-ickb-prod-eq/proposal rev-parse HEAD
112+
command -v capsule || true
113+
command -v cross || true
114+
command -v docker || true
115+
cd /tmp/cellscript-ickb-prod-eq/v1-core/scripts
116+
cargo test --locked
117+
```
118+
119+
Result: v1-core and proposal resolved to the same commits listed above.
120+
`docker` was available at `/opt/homebrew/bin/docker`, but `capsule` and `cross`
121+
were not installed. `cargo test --locked` compiled the iCKB contract crates and
122+
the `tests` crate, then failed the two test cases because the test loader could
123+
not find prebuilt script binaries under `scripts/build/debug`.
124+
104125
iCKB source inspection:
105126

106127
```bash
@@ -153,9 +174,13 @@ Benchmark tests after implementation:
153174

154175
```bash
155176
cargo test --locked -p cellscript --test ickb_benchmark
177+
cargo test --locked -p cellscript --test v0_17 ickb_benchmark_specs_compile_under_0_17_strict_source_mode -- --test-threads=1
178+
target/debug/cellc tests/benchmarks/ickb_specs/ickb_logic.cell --target-profile ckb --target riscv64-asm --debug
156179
```
157180

158-
Result: passed, 4 tests.
181+
Result: the iCKB benchmark tests passed, and `ickb_logic.cell` compiled to
182+
RISC-V assembly after the parser was tightened so all-caps constants immediately
183+
before `{ ... }` branches are not misread as struct initializers.
159184

160185
## Assumptions And Gaps
161186

@@ -167,3 +192,7 @@ Result: passed, 4 tests.
167192
executions.
168193
- iCKB's own reusable CKB test harness could not be run to completion without
169194
a prior Capsule build producing `build/debug` or `build/release` binaries.
195+
- The iCKB 10% oversized-deposit discount formula is now present in
196+
`tests/benchmarks/ickb_specs/ickb_logic.cell`; this proves expression/compile
197+
coverage for the formula, not production equivalence for the surrounding DAO
198+
HeaderDep lineage.

0 commit comments

Comments
 (0)