diff --git a/.woodpecker/ci.yml b/.woodpecker/ci.yml index c7d5c66..7dca6be 100644 --- a/.woodpecker/ci.yml +++ b/.woodpecker/ci.yml @@ -127,12 +127,11 @@ steps: name=$(basename "$seed") echo "--- Transpiling $name ---" if ! npx tsx tools/push3-transpiler/src/index.ts "$seed" onchain/src/OptimizerV3Push3.sol; then - echo "FAIL: $name failed to transpile" >&2 - failed=1 + echo "WARN: $name failed to transpile (invalid program) — skipping" >&2 continue fi echo "--- Compiling $name ---" - if ! (cd onchain && forge build --silent); then + if ! (cd onchain && forge build --skip test script --silent); then echo "FAIL: $name transpiled but Solidity compilation failed" >&2 failed=1 fi diff --git a/tools/push3-transpiler/test_transpiler_clamping.sh b/tools/push3-transpiler/test_transpiler_clamping.sh index 8e048d6..71d2780 100755 --- a/tools/push3-transpiler/test_transpiler_clamping.sh +++ b/tools/push3-transpiler/test_transpiler_clamping.sh @@ -85,8 +85,8 @@ run_transpiler() { fi } -# ── Test 5: anchorWidth literal > uint24 max → transpiler error ────────────── -echo "Test 5: anchorWidth = 1e18 (literal) → transpiler error, not silent Solidity failure" +# ── Test 6: anchorWidth literal > uint24 max → transpiler error ────────────── +echo "Test 6: anchorWidth = 1e18 (literal) → transpiler error, not silent Solidity failure" # Push3 program: push 4 values (discoveryDepth, anchorWidth=1e18, anchorShare, ci). # The transpiler pops top-4 from DYADIC stack; these literals sit on top of the @@ -103,8 +103,8 @@ assert_contains \ "$STDERR" \ "anchorWidth literal (1000000000000000000) is outside uint24 range [0, 16777215]" -# ── Test 6: valid anchorWidth literal (in range) → accepted, wraps with % (2**24) ─ -echo "Test 6: anchorWidth = 100 (valid literal) → accepted, output uses % (2**24)" +# ── Test 7: valid anchorWidth literal (in range) → accepted, wraps with % (2**24) ─ +echo "Test 7: anchorWidth = 100 (valid literal) → accepted, output uses % (2**24)" INPUT_6="$TMPDIR_T/valid_aw.push3" OUTPUT_6="$TMPDIR_T/valid_aw.sol" @@ -125,8 +125,8 @@ assert_contains \ "$SOL_6" \ "uint24(100 % (2**24))" -# ── Test 7: negative ci literal → transpiler error ─────────────────────────── -echo "Test 7: ci = -1 (negative literal) → transpiler error" +# ── Test 8: negative ci literal → transpiler error ─────────────────────────── +echo "Test 8: ci = -1 (negative literal) → transpiler error" STDERR=$(run_transpiler "( 300000000000000000 @@ -140,8 +140,8 @@ assert_contains \ "$STDERR" \ "ci is a negative literal (-1)" -# ── Test 8: negative anchorShare literal → transpiler error ────────────────── -echo "Test 8: anchorShare = -5 (negative literal) → transpiler error" +# ── Test 9: negative anchorShare literal → transpiler error ────────────────── +echo "Test 9: anchorShare = -5 (negative literal) → transpiler error" STDERR=$(run_transpiler "( 300000000000000000 @@ -155,8 +155,8 @@ assert_contains \ "$STDERR" \ "anchorShare is a negative literal (-5)" -# ── Test 9: negative discoveryDepth literal → transpiler error ─────────────── -echo "Test 9: discoveryDepth = -99 (negative literal) → transpiler error" +# ── Test 10: negative discoveryDepth literal → transpiler error ─────────────── +echo "Test 10: discoveryDepth = -99 (negative literal) → transpiler error" STDERR=$(run_transpiler "( -99 @@ -170,8 +170,8 @@ assert_contains \ "$STDERR" \ "discoveryDepth is a negative literal (-99)" -# ── Test 10: negative anchorWidth literal → transpiler error ───────────────── -echo "Test 10: anchorWidth = -1 (negative literal) → transpiler error" +# ── Test 11: negative anchorWidth literal → transpiler error ───────────────── +echo "Test 11: anchorWidth = -1 (negative literal) → transpiler error" STDERR=$(run_transpiler "( 300000000000000000 @@ -185,8 +185,8 @@ assert_contains \ "$STDERR" \ "anchorWidth literal (-1) is outside uint24 range [0, 16777215]" -# ── Test 11: forge build — transpiler output compiles (regression for #900) ── -echo "Test 11: forge build on valid transpiler output (regression for #900)" +# ── Test 12: forge build — transpiler output compiles (regression for #900) ── +echo "Test 12: forge build on valid transpiler output (regression for #900)" REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" FORGE_BIN="$(command -v forge 2>/dev/null || true)" @@ -217,8 +217,8 @@ else fi fi -# ── Test 12: ci literal > 1e18 → transpiler error ──────────────────────────── -echo "Test 12: ci = 2e18 (literal) → transpiler error" +# ── Test 13: ci literal > 1e18 → transpiler error ──────────────────────────── +echo "Test 13: ci = 2e18 (literal) → transpiler error" STDERR=$(run_transpiler "( 300000000000000000 @@ -232,8 +232,8 @@ assert_contains \ "$STDERR" \ "ci literal (2000000000000000000) exceeds 1e18 (max allowed)" -# ── Test 13: anchorShare literal > 1e18 → transpiler error ─────────────────── -echo "Test 13: anchorShare = 2e18 (literal) → transpiler error" +# ── Test 14: anchorShare literal > 1e18 → transpiler error ─────────────────── +echo "Test 14: anchorShare = 2e18 (literal) → transpiler error" STDERR=$(run_transpiler "( 300000000000000000 @@ -247,8 +247,8 @@ assert_contains \ "$STDERR" \ "anchorShare literal (2000000000000000000) exceeds 1e18 (max allowed)" -# ── Test 14: discoveryDepth literal > 1e18 → transpiler error ──────────────── -echo "Test 14: discoveryDepth = 2e18 (literal) → transpiler error" +# ── Test 15: discoveryDepth literal > 1e18 → transpiler error ──────────────── +echo "Test 15: discoveryDepth = 2e18 (literal) → transpiler error" STDERR=$(run_transpiler "( 2000000000000000000