Repository navigation
Conversation
…s into wasm (css#99) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HwLsLqnBm3u7Rwk8pezYB3
|
Plan check Generated by Claude Code |
|
Plan check Generated by Claude Code |
|
Independent review (a separate reviewer agent, not the author) of head dc73aa8: changes needed
Generated by Claude Code |
|
Plan check Generated by Claude Code |
|
Independent review (a separate reviewer agent, not the author) of head dc73aa8: approved Round 2. The three findings of the earlier review are met. (1) Rows 5 to 9 make the scratch app: its bats.toml, a wasmcss.bats with #target wasm binary that calls book_sheet_read, book_style_read, book_read_free and book_decls_free, the lock and the wasm build. Row 2 clones the checkout, row 3 makes the clone's branch main at the head, row 4 uploads from it. (2) Row 11 runs wasm-objdump -x in the scratch app's directory, which rows 1 to 9 made, and names the check job as the second Done-when part. (3) The p2 ticket css#101 exists, open, labelled p2, named in the body and in row 10. Every path a row reads is made by an earlier row, under the ignored build/css99-wasm/. No row is timed. The Done-when is met as written. Missed earlier: none. Generated by Claude Code |
|
Independent review (a separate reviewer agent, not the author) of head dc73aa8: approved Head dc73aa8. The Evidence block of the body shows wasm-objdump -x of a wasm build that calls book_sheet_read, book_style_read and their frees: no Import section, so none of the four llint names; contrast_45_int_of is linked and contrast_45_of is not. The comparison 10*(a+P) >= 45*(b+P) is b+P <= floor(2*(a+P)/9) for integers and stays under 2^31. The old contrast_45_of stays and is called by the existing tests; test_contrast_int_* and test_contrast_int_agrees_with_old call the new form. The p2 removal ticket is css#101. check, layout, text-lint and canonical-files are green at the head. No finding. Generated by Claude Code |
Fixes #99
Head: dc73aa8
Done-when digest: f8933c3e58d0785d
Plan
.github/repository-version, in a directory of the checkout's ignoredbuild/that this row makes):bats clone-repository 061c714942701a3fba2dd7f870a25ed416f81ed1 --repository build/css99-wasm/repo.git clone -q . build/css99-wasm/css-main.mainat the head (bats uploadnames the version after the checked-out branch, and anything butmainuploads adev1version):git -C build/css99-wasm/css-main checkout -q -B main dc73aa8527b15ff095ca6fe98a9f8b1325cd816c.env -C build/css99-wasm/css-main bats upload --repository ../repo.env mkdir -p build/css99-wasm/app/src/bin.bats.toml: packagewasmcss,kind = "bin",unsafe = false, dependenciescss,array,builder:env printf '%s\n' '[package]' 'name = "wasmcss"' 'kind = "bin"' 'unsafe = false' '' '[dependencies]' '"css" = ""' '"array" = ""' '"builder" = ""' > build/css99-wasm/app/bats.toml.src/bin/wasmcss.bats:#target wasm binary, and amain0that builds the sheetp { color: #000 }in a builder, reads it withbook_sheet_readandbook_style_read(grammar 1, the light ground 250 248 245 and the sepia ground 244 236 216) and frees both reads withbook_read_freeandbook_decls_free, then frees the array:env printf '%s\n' '(* wasmcss: a wasm app that calls css book_sheet_read and book_style_read (css#99) *)' '#target wasm binary' '#include "share/atspre_staload.hats"' '#use css as C' '#use array as A' '#use builder as B' 'staload CB = "css/src/book.sats"' '' 'implement main0 () = let' ' var sheet : $B.builder(0) = $B.create()' ' val () = $B.bput(sheet, "p { color: #000 }")' ' val @(sheet_arr, sheet_len) = $B.to_arr(sheet)' ' val @(sheet_len_pf | sheet_barr) = $A.barr_of_arr(sheet_arr)' ' val @(sheet_frozen, sheet_view) = $A.barr_freeze(sheet_barr)' ' val read = $CB.book_sheet_read(sheet_view, sheet_len, 1, @(250, 248, 245), @(244, 236, 216))' ' val () = $CB.book_read_free(read)' ' val decls = $CB.book_style_read(sheet_view, sheet_len, 1, @(250, 248, 245), @(244, 236, 216))' ' val () = $CB.book_decls_free(decls)' ' val () = $A.cborrow_drop(sheet_frozen, sheet_view)' ' val () = $A.barr_free($A.barr_thaw(sheet_frozen))' 'in end' > build/css99-wasm/app/src/bin/wasmcss.bats.env -C build/css99-wasm/app bats lock --repository ../repo.dist/debug/wasmcss.wasmof its directory:env -C build/css99-wasm/app bats build --only debug --only wasm --repository ../repo.gh api repos/bats-lang/css/issues/101 -q .title.book_sheet_readandbook_style_readlink into a wasm app without anyllintimport, with the same CONTRAST proofs and the same answers as before on every case the existing tests play: demonstrated by theatspre_g1int2int_int_llint,atspre_g1int_add_llint,atspre_g1int_mul_llintandatspre_g1int_gte_llintnames being absent fromwasm-objdump -ximports of a wasm build that calls both functions (the command and its output in the pull request's Evidence), and by this repository'scheckjob passing on the pull request's head. Evidence command:env -C build/css99-wasm/app wasm-objdump -x dist/debug/wasmcss.wasmin the scratch app's directory (rows 1 to 9 make it: the clone of the pinned repository, the upload of this head, the source ofmain0and the build; the compiler on PATH is built from the checked-in seed of a bats checkout, thedebug/batstarget ofmakein a copy of itsbootstrap/c); CI pointer: workflowcheck.yml, jobcheck, greppablecheck.Overlap:
contrast_45_of(llint) is kept beside the newcontrast_45_int_of;src/book_tests.batscalls the old form intest_contrast_black_on_whiteand four more, and compares both intest_contrast_int_agrees_with_old. The p2 ticket that removes the old form is css#101 (row 10).Execution
scripts/gen-contrast.pywritescontrast_45_int_of(regenerated intosrc/contrast.bats):2 * (alo + P) / 9 >= bhi + P, the same as10 * (alo + P) >= 45 * (bhi + P)for integers, with the left side under 2^31; the CONTRAST proof is the same (the solver accepted it).src/book.batscalls the new form.bats checkpassed andbats test --only nativeprintedall tests passed(newtest_contrast_int_*).Deviations: none
Evidence
Generated by Claude Code