Skip to content

vere64 - #970

Open
matthew-levan wants to merge 267 commits into
developfrom
ml/64
Open

vere64#970
matthew-levan wants to merge 267 commits into
developfrom
ml/64

Conversation

@matthew-levan

@matthew-levan matthew-levan commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Cribbed from #794.

This PR introduces 64-bit Vere. c3_w is now either 32 or 64 bit, depending on if it was compiled with -DVERE64 (off by default, or on with zig build -Dvere64).

The following work still needs to be done:

  • define final typedefs, update usages accordingly
  • every appearance of _tmp in pkg/noun (excluding pkg/noun/jets) (~800 locations)
    • trace.{c,h}
    • ship.{c,h}
    • nock.h
    • version.h
    • imprison.{c,h}
    • jets.{c,h}
    • allocate.{c,h}
    • retrieve.{c,h}
    • *_tests.c
  • every appearance of _tmp in pkg/noun/jets
  • look at diff of pre and post VERE64 compilation with -Wconversion flag. Investigate every instance.
  • run with llvm addr sanitizer, ubsan
  • audit every jet
  • migrations: bidirectional (use MSB of version tag to mark if vere64 or not? maybe also add metadata for pointer compression)
  • integrate Joe's page based allocator
  • new rsignal_setjmp/longjmp may have volatility problems (talk to Joe. maybe use atomics?)
  • pkg/vere/noun-tests is completely broken
    • ensure noun tests make sense/are worth having
  • every appearance of _tmp in any other subdirectory (~1000 locations)
  • c3_w_clz, ctz, pc occurrences (we should change current occurrences to _tmp as we did with u3r_word, etc and go through them
  • c3_etch_word, c3_sift_word occurrences (also change to _tmp)
  • make sure everything works (C tests and hoon tests included) still for vere32
  • revendor murmur3 with a size_t len
  • test really big nouns in ames/fine/mesa
  • the event log and other lmdb state should not need migration. we should double check lmdb.c, disk.c
  • there's a lot of bloq size related things in the jets that could be changed to greater than 32 for the 32 bit case
  • (mug .(eny 0, now 0)) equality test for fakezods booted in 32-bit and 64-bit modes
  • mug-verified automated migration tests in ci

Benchmarks:

  • M4 Pro macOS Tahoe 26.3.1(a)
ackermann dec add fibonacci bigslot
vere64 a959ae s/2.007.327 ms/188.825 ms/92.988 µs/730 ms/1.259
develop 4e75c9e s/2.045.726 ms/192.338 ms/92.393 µs/809 ms/1.457
  • Framework 13 Ryzen AI 9 HX 370
ackermann dec add fibonacci bigslot
vere64 a959ae s/2.577.564 ms/279.785 ms/127.991 µs/785 ms/1.356
develop 4e75c9e s/2.490.242 ms/262.862 ms/126.190 µs/762 ms/1.386

barter-simsum and others added 30 commits April 3, 2025 13:38
the 64-bit ball travels in `u3R->esc.why_w` rather than longjmp's int
return, which had spread thirteen `#ifdef` fragments across the four
trap sites and `u3m_bail` -- three per site, one of which was missed.
consolidates them into a macro pair, leaving every trap site identical
in both bitnesses.

`u3m_trap` latches the ball in the controlling expression rather than
in the body of the `else`, so a bail in the escape path cannot clobber
`esc.why_w` before it is read.  the trap side must stay a macro: a
`jmp_buf` does not outlive the frame that filled it.

also drops the dead `u3m_trap()`, unused and silently wrong under
VERE64, along with the `#if 0`'d function declaration beside it.
on windows `_longjmp` expands to a brace-enclosed block rather than an
expression, so the VERE64 arm's comma operator was a syntax error under
x86_64-windows-gnu.  `u3m_escape` is only ever used as a statement, so
both arms become `do { ... } while ( 0 )`.

`u3m_trap` is unaffected: windows `setjmp` does expand to a
parenthesized expression.
Comment thread pkg/noun/jets/c/bex.c
return u3m_bail(c3__fail);
}

// We don't currently support atoms 2GB or larger (fails while

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this still hold?

Comment thread pkg/noun/jets/e/rs.c

static inline void
_set_rounding(c3_w a)
_set_rounding(c3_y a)

@dozreg-toplud dozreg-toplud Aug 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here and elsewhere: this must be a u3_atom or a type of the same width. Otherwise an indirect atom will get incorrectly interpreted

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.

4 participants