Repository navigation
Modeled C §66: UAT and examples rewritten to the facade surface; zlib/bzip2/libcurl facades; user-programs-safe - #1625
Merged
Conversation
Contributor
Author
|
Verification with the release binary of f7b90b9 (
|
ehartford
force-pushed
the
modeled-c-uat-rewrite
branch
from
September 24, 2026 16:43
f7b90b9 to
b5be8b7
Compare
ehartford
force-pushed
the
modeled-c-uat-rewrite
branch
from
September 24, 2026 16:52
b5be8b7 to
6ff3e6b
Compare
ehartford
force-pushed
the
modeled-c-uat-rewrite
branch
from
September 24, 2026 17:30
6ff3e6b to
b647daf
Compare
added 2 commits
September 24, 2026 13:32
…> 0 (ruling §66); the C-package UAT writes the facade into the project as src/facades/<lib>.w The fixture is what an application developer writes over `with get c.sqlite3`: Database.open / db.exec / db.prepare / stmt.step / stmt.column_int, the statement finalized before the connection closes, on every path. The exec call is spelled with #1618's `None` (no row callback); it compiles once that lands (the interim unit-userdata spelling traps the compiler, #1622). The runner copies lib/facades/sqlite3.w beside the program so the fresh project resolves `use facades.sqlite3` itself, never through the parent-lib/ walk into this repository. Ceremony left on the surface is filed: #1624 (prepare's -1/null, exec's errmsg slot).
…diomatic guide and the release runbook track the facade surface (ruling §66) A spec change updates the example in the same change: the raw sqlite3_open/&raw mut db spellings and the hand-rolled Drop wrapper give way to Database.open and the facade clauses that generate it.
ehartford
force-pushed
the
modeled-c-uat-rewrite
branch
from
September 24, 2026 17:32
b647daf to
9702354
Compare
ehartford
marked this pull request as ready for review
September 24, 2026 18:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ruling §66's last step, now that the SQLite facade (#1619) is on main: the user programs are rewritten to the facade surface. Stacks on #1618 (branch
modeled-c-stage12b): the sqlite3 fixture spells the callback-less exec withNoneand compiles once that lands.sqlite3 (done)
build/release_uat_fixtures/sqlite3_main.w: 11unsafe→ 0.Database.open/db.exec/db.prepare/stmt.step/stmt.column_int; the statement is finalized before the connection closes on every path. Same output (sqlite3 UAT passed), verified on stage1 with the interim callback spelling (a closure +i32userdata) — theNonespelling waits for Modeled C: a callback contract cannot mark the callback optional; sqlite3_exec with no callback ("If the callback is NULL, no callback is invoked") needs a no-op fn (ruling §44) #1618.build/release_uat.w: the C-package UAT writeslib/facades/sqlite3.winto the fresh project assrc/facades/sqlite3.w(§16.2b.1: the facade is the project's own until the package ships it), souse facades.sqlite3resolves in the project itself and not through the parent-lib/walk into this repository.build.w: the facade is an input of:release-sqlite3-uat.with_for_ai.md§16,with-migration-guide.md,with-idiomatic-guide.md(the hand-rolledimpl Dropwrapper → the facade clauses),with-release-runbook.md.zlib / bzip2 / libcurl: stopped at zlib (§65)
No facade written. The one-shot zlib surface (
compress/uncompress) and bzip2'sBZ2_bzBuffToBuff*take caller-owned buffers with a length parameter, and the facade language has no clause that pairs a pointer with its length. Evidence in #1621: a plainfn compress / lendchecks clean and turns the raw-pointer call safe with no bounds contract — the partial model §16.2b.3 forbids — while the program still spells every&raw mut … as *mut Bytef. Those three fixtures keep theirunsafe(8 + 5 + 6 = 19 uses; the count was 28 with sqlite3's 11), so:user-programs-safestays red on them until #1621 lands.Gaps filed
fn compress / lendrenders a safe call over raw pointers with no bounds contract #1621 Modeled C: no caller-owned buffer + length clause;lendrenders a safe call over raw pointers.()userdata (db.exec(sql, cb, (), null)) traps the compiler in llvm::DataLayout::getTypeSizeInBits (#1618's interim spelling) #1622 Codegen:()userdata in a facade callback traps the compiler inllvm::DataLayout::getTypeSizeInBits(Modeled C: a callback contract cannot mark the callback optional; sqlite3_exec with no callback ("If the callback is NULL, no callback is invoked") needs a no-op fn (ruling §44) #1618's interim spelling).let Ok(x) = … else: return 1infn main:(inferred return) fails the MIR validator at thereturn;-> i32spelled explicitly compiles #1623 Sema/MIR:let Ok(x) = … else: return 1infn main:fails the MIR validator (return not seen by return-type inference).prepare(sql, -1, null),exec(…, null)) stay on the presented method — ceremony the facade should remove #1624 Facade presentation:prepare(sql, -1, null)/exec(…, null)trailing raw arguments are ceremony.Not touched (listed)
examples/has noc_importprogram (examples/nebula/README.mdmentions raw sqlite3 calls in prose only);docs/completed/*are archived designs and keep their historical spellings; no homepage sources are in the repo.Verification
with build :dev): the rewritten fixture logic runs and printssqlite3 UAT passed; the four repros above are pinned in their issues.:user-programs-safe/:release-sqlite3-uat: posted below once the release binary is built.No
:fixpoint/:test/audits on this branch (folded into the coordinator's stack battery).