Skip to content

Bootstrap Cupid OS toward a Cupid-owned toolchain - #33

Draft
frankischilling wants to merge 623 commits into
mainfrom
bootstrap/cupid-self-hosting
Draft

Bootstrap Cupid OS toward a Cupid-owned toolchain#33
frankischilling wants to merge 623 commits into
mainfrom
bootstrap/cupid-self-hosting

Conversation

@frankischilling

@frankischilling frankischilling commented Jul 26, 2026

Copy link
Copy Markdown
Member

Purpose

This draft carries the ongoing Cupid OS bootstrap. The normal build is moving toward CupidC, CupidASM, CupidDis, CupidLD, and CupidObj without reducing the operating system, Doom, or vendored source to fit the current tools. TempleOS remains reference material only.

Current checkpoint

The latest branch work contains four green compiler and runtime steps:

  • 91aabe5 carries private floating lvalues through pointers, multidimensional arrays, function and method parameters, and record fields.
  • a67ce0a adds represented float4 and double2 arrays, arithmetic operators, compound stores, and their runtime contracts.
  • 8f7d930 converts private decimal floating literals with fixed-size integer arithmetic and one ties-to-even rounding step at the requested IEEE width.
  • cfb8105 resolves Browser assignment targets once, owns bindings by scope, makes stack and string exhaustion transactional, preserves native function IDs, checks array-length limits, and formats finite numbers without signed narrowing. It also adds tagged structure typedefs, checked private allocation and constant arithmetic, complete REPL record rollback, and correct addresses for both &record.field and &pointer->field.

The Browser self-test uses the new compiler behavior directly. Its ordinary tagged saved-reference record remains intact; the compiler was extended instead of rewriting the source around the missing feature. ADRs 0218 and 0219, the bootstrap log and matrices, root docs, wiki, and in-OS CTXT manuals record the decisions, failed probes, proof, and limits.

Current proof

  • python -m unittest tests.test_browser_cupidc_numbers passes 20 tests.
  • python -m unittest tests.test_private_cupidc_call_abi passes 90 tests.
  • Complete private CupidC discovery passes 105 tests.
  • The GUI terminal harness passes 101 tests.
  • make -j4 all passes in 585.918 seconds. The 9,014,992-byte kernel ELF has SHA-256 7c9b028511cbd80975decfb05144e25196dfe1a3135d4fd2371164081369c7d3; the 8,809,620-byte flat kernel has SHA-256 e56fe5efe850dc6491dce821a058be373843916886d29529249fc36f929742fe.
  • The resulting 209,715,200-byte image has SHA-256 e513ad89ab307c7f9a4b83456c93ed28a08487c6a429af355e2fac359e8b7476.
  • A private-image browser --selftest run passes in 93.885 seconds with four CPUs, QEMU's max CPU model, e1000, the strong SMP validator, all ten expected parser diagnostics, the exact 26-field Browser marker, and clean JIT completion. Its 39,588-byte log has SHA-256 eb994c43e7925956cf3d7f0d9d59ea4f6937ad6847386faf2e9ae1797212ee77.
  • The regenerated and independently checked graph contains 718 active inputs, 449 transforms, 255 requirements, and 25 classified unreachable files. Its active-source digest is 86743bfd29a6a18c72ee19835a427fbef529b099bedd535894d3b3c598d6d7eb.
  • No active .c source was added or changed, and no TempleOS file was built, modified, or counted.

Remaining work

This stays a draft and must not be merged yet. Issue #31 remains open for the rest of the embedded Cupid mode surface. Browser object-to-primitive conversion, BigInt, full ECMAScript coercion and formatting, and the full unsigned array-index range remain open. Private wide strings, larger tokens, broader typedef declarators and tag scope, more compiler self-hosting, and the remaining host orchestration and platform dependencies also remain open. This checkpoint moves no build owner and removes no host dependency.

Copy link
Copy Markdown
Member Author

Pushed 1d4d007, which transfers Nuked OPL3 to checked CupidC and keeps the source body byte-for-byte unchanged under its new .cc name.

The commit adds a frozen four-file compile closure, live-drift rejection, bounded frontier publication retries, and isolation from hidden compiler staging trees. Six new regression methods cover the production rule, private input use, drift preservation, transient and persistent publication failures, and concurrent staging.

Verification is complete:

  • 146 checked-in roots compile twice with byte-identical objects against 434 frozen inputs.
  • make -j2 all WAD_SRCS= passes, and the flat kernel matches the final image at LBA 5.
  • e1000 and RTL8139 four-vCPU gates pass networking, USB, graphics, both audio paths, and in-OS CupidC.
  • make test returns zero with 768 passes and one expected Windows skip.
  • The active-source audit and both final code reviews pass with no findings.

The branch remains bootstrap/cupid-self-hosting, and this draft PR is still open. Nothing was merged into main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant