Skip to content

Commit a2f950a

Browse files
committed
Merge branch 'ml/64' into ml/bob
2 parents 7d6cbf0 + 8c5d786 commit a2f950a

224 files changed

Lines changed: 2866 additions & 1897 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/shared.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
echo
7474
swapon --show
7575
echo
76-
76+
7777
- name: Set memory overcommit
7878
run: |
7979
sudo sysctl -w vm.overcommit_memory=1
@@ -86,24 +86,24 @@ jobs:
8686

8787
- name: Build binaries
8888
run: |
89-
# Add -Dvere32 flag for 32-bit builds
90-
VERE32_FLAG=""
91-
if [[ "${{ matrix.bits }}" == "32" ]]; then
92-
VERE32_FLAG="-Dvere32"
89+
# Add -Dvere64 flag for 64-bit builds
90+
VERE64_FLAG=""
91+
if [[ "${{ matrix.bits }}" == "64" ]]; then
92+
VERE64_FLAG="-Dvere64"
9393
fi
9494
9595
if [[ "${{ inputs.pace }}" == "live" ]]; then
9696
zig build \
9797
-Dall \
9898
-Drelease \
99-
$VERE32_FLAG \
99+
$VERE64_FLAG \
100100
--summary all
101101
else
102102
zig build \
103103
-Dall \
104104
-Doptimize=ReleaseFast \
105105
-Dpace=${{inputs.pace}} \
106-
$VERE32_FLAG \
106+
$VERE64_FLAG \
107107
--summary all
108108
fi
109109
- name: Run unit tests
@@ -124,10 +124,10 @@ jobs:
124124
- name: Build test binary
125125
if: ${{ inputs.fake_tests }}
126126
run: |
127-
# Add -Dvere32 flag for 32-bit builds
128-
VERE32_FLAG=""
129-
if [[ "${{ matrix.bits }}" == "32" ]]; then
130-
VERE32_FLAG="-Dvere32"
127+
# Add -Dvere64 flag for 64-bit builds
128+
VERE64_FLAG=""
129+
if [[ "${{ matrix.bits }}" == "64" ]]; then
130+
VERE64_FLAG="-Dvere64"
131131
fi
132132
133133
zig build \
@@ -139,7 +139,7 @@ jobs:
139139
-Dc3dbg \
140140
-Dsnapshot-validation \
141141
-Durth-mass \
142-
$VERE32_FLAG \
142+
$VERE64_FLAG \
143143
--summary all
144144
145145
- name: Boot fake ship
@@ -270,6 +270,7 @@ jobs:
270270
- name: Build 64-bit migration binary
271271
run: |
272272
zig build \
273+
-Dvere64 \
273274
-Doptimize=ReleaseFast \
274275
-Dpace=${{inputs.pace}} \
275276
-Dbinary-name=vere-migration \
@@ -278,13 +279,12 @@ jobs:
278279
- name: Build 32-bit migration binary
279280
run: |
280281
zig build \
281-
-Dvere32 \
282282
-Doptimize=ReleaseFast \
283283
-Dpace=${{inputs.pace}} \
284284
-Dbinary-name=vere32-migration \
285285
--summary all
286286
287-
- name: Run v5↔v6 roundtrip migration test
287+
- name: Run 32↔64 roundtrip migration test
288288
env:
289289
VERE64_BINARY: "zig-out/x86_64-linux-musl/vere-migration"
290290
VERE32_BINARY: "zig-out/x86_64-linux-musl/vere32-migration"

build.zig

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const BuildCfg = struct {
107107
urth_mass: bool = false,
108108
ubsan: bool = false,
109109
asan: bool = false,
110-
vere32: bool = false,
110+
vere64: bool = false,
111111
tracy_enable: bool = false,
112112
tracy_callstack: bool = false,
113113
tracy_no_exit: bool = false,
@@ -194,10 +194,10 @@ pub fn build(b: *std.Build) !void {
194194
else
195195
false;
196196

197-
const vere32 = b.option(
197+
const vere64 = b.option(
198198
bool,
199-
"vere32",
200-
"Compile in 32-bit mode",
199+
"vere64",
200+
"Compile in 64-bit mode",
201201
) orelse false;
202202

203203
const tracy_enable = b.option(bool, "tracy", "Enable Tracy profiler") orelse false;
@@ -240,7 +240,7 @@ pub fn build(b: *std.Build) !void {
240240
.urth_mass = urth_mass,
241241
.asan = asan,
242242
.ubsan = ubsan,
243-
.vere32 = vere32,
243+
.vere64 = vere64,
244244
.tracy_enable = tracy_enable,
245245
.tracy_callstack = tracy_callstack,
246246
.tracy_no_exit = tracy_no_exit,
@@ -365,7 +365,7 @@ fn buildBinary(
365365
if (cfg.snapshot_validation)
366366
try urbit_flags.appendSlice(&.{"-DU3_SNAPSHOT_VALIDATION"});
367367

368-
if (!cfg.vere32)
368+
if (cfg.vere64)
369369
try urbit_flags.appendSlice(&.{"-DVERE64"});
370370

371371
if (cfg.urth_mass)
@@ -449,6 +449,7 @@ fn buildBinary(
449449
.target = target,
450450
.optimize = optimize,
451451
.copt = copts,
452+
.vere64 = cfg.vere64,
452453
});
453454

454455
const pkg_vere = b.dependency("pkg_vere", .{
@@ -457,7 +458,7 @@ fn buildBinary(
457458
.copt = copts,
458459
.pace = cfg.pace,
459460
.version = cfg.version,
460-
.vere32 = cfg.vere32,
461+
.vere64 = cfg.vere64,
461462
});
462463

463464
const curl = b.dependency("curl", .{

ext/urcrypt/build.zig.zon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
.hash = "N-V-__8AAJ4DSwC7aDpt90TmGPWKAI6q4-titwp4M0zsZ2vY",
1616
},
1717
.urcrypt = .{
18-
.url = "https://github.com/urbit/urcrypt/archive/465aad6262f2710f76f75adfe74effb5751c5ab3.tar.gz",
19-
.hash = "N-V-__8AAL3OSQDA9xQasK60FkxcKuQoSANeWy_f9SxmxX1X",
18+
.url = "https://github.com/urbit/urcrypt/archive/6c93535d46adffcd1495f904bac91d43b2d6d555.tar.gz",
19+
.hash = "N-V-__8AAEPPSQAFB28-gqWMJB7_zp5ZIS8wIN4boyLzAWRb",
2020
},
2121
},
2222
.paths = .{

migration-test.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22
# migration-test.sh: roundtrip migration test for the vere loom.
33
#
4-
# Tests the v5↔v6 loom migration path by running three sequential boots on
4+
# Tests the 32↔64-bit loom migration path by running three sequential boots on
55
# the same fake pier:
6-
# 1. 32-bit vere: fresh boot from pill → saves a v5 (32-bit) loom snapshot
7-
# 2. 64-bit vere: re-boots same pier → migrates v5→v6 (u3_migrate_v6)
8-
# 3. 32-bit vere: re-boots same pier → restores v6→v5 (u3_restore_v5)
6+
# 1. 32-bit vere: fresh boot from pill → saves a 32-bit loom snapshot
7+
# 2. 64-bit vere: re-boots same pier → migrates 32→64 (u3_migrate_64)
8+
# 3. 32-bit vere: re-boots same pier → migrates 64→32 (u3_migrate_32)
99
#
1010
# Required environment variables:
1111
# VERE32_BINARY 32-bit vere binary path, relative to GITHUB_WORKSPACE or PWD
@@ -89,9 +89,9 @@ cleanup() {
8989
}
9090
trap cleanup EXIT
9191

92-
# ── Step 1: 32-bit vere → create v5 snapshot ─────────────────────────────────
92+
# ── Step 1: 32-bit vere → create 32-bit snapshot ─────────────────────────────
9393

94-
echo "=== migration step 1: boot with 32-bit vere (create v5 snapshot) ==="
94+
echo "=== migration step 1: boot with 32-bit vere (create 32-bit snapshot) ==="
9595

9696
rm -rf "$pier"
9797
"$vere32" --lite-boot --daemon --fake bus \
@@ -108,11 +108,11 @@ lensd "$port" '+vats %base'
108108
lensa "$port" hood '+hood/exit'
109109
wait_for_shutdown "$pier"
110110

111-
echo "=== step 1 done: v5 snapshot saved ==="
111+
echo "=== step 1 done: 32-bit snapshot saved ==="
112112

113-
# ── Step 2: 64-bit vere → migrate v5→v6 ──────────────────────────────────────
113+
# ── Step 2: 64-bit vere → migrate 32→64 ──────────────────────────────────────
114114

115-
echo "=== migration step 2: boot with 64-bit vere (v5→v6 migration) ==="
115+
echo "=== migration step 2: boot with 64-bit vere (32→64 migration) ==="
116116

117117
rm -f "$pier/.http.ports"
118118
"$vere64" --lite-boot --daemon "$pier"
@@ -126,11 +126,11 @@ lensd "$port" '+vats %base'
126126
lensa "$port" hood '+hood/exit'
127127
wait_for_shutdown "$pier"
128128

129-
echo "=== step 2 done: v5→v6 migration succeeded ==="
129+
echo "=== step 2 done: 32→64 migration succeeded ==="
130130

131-
# ── Step 3: 32-bit vere → restore v6→v5 ──────────────────────────────────────
131+
# ── Step 3: 32-bit vere → migrate 64→32 ──────────────────────────────────────
132132

133-
echo "=== migration step 3: boot with 32-bit vere (v6→v5 restore) ==="
133+
echo "=== migration step 3: boot with 32-bit vere (64→32 migration) ==="
134134

135135
rm -f "$pier/.http.ports"
136136
"$vere32" --lite-boot --daemon "$pier"
@@ -144,5 +144,5 @@ lensd "$port" '+vats %base'
144144
lensa "$port" hood '+hood/exit'
145145
wait_for_shutdown "$pier"
146146

147-
echo "=== step 3 done: v6→v5 restore succeeded ==="
147+
echo "=== step 3 done: 64→32 migration succeeded ==="
148148
echo "Migration roundtrip complete."

pkg/c3/motes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@
452452
# define c3__fond c3_s4('f','o','n','d')
453453
# define c3__for c3_s3('f','o','r')
454454
# define c3__forb c3_s4('f','o','r','b')
455+
# define c3__ford c3_s4('f','o','r','d')
455456
# define c3__fore c3_s4('f','o','r','e')
456457
# define c3__fork c3_s4('f','o','r','k')
457458
# define c3__form c3_s4('f','o','r','m')

pkg/noun/allocate.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,7 @@ u3a_print_quac(FILE* fil_u, c3_h den_h, u3m_quac* mas_u)
16901690
u3m_quac*
16911691
u3a_mark_road()
16921692
{
1693-
u3m_quac** qua_u = c3_malloc(sizeof(*qua_u) * 15);
1693+
u3m_quac** qua_u = c3_malloc(sizeof(*qua_u) * 16);
16941694

16951695
qua_u[0] = c3_calloc(sizeof(*qua_u[0]));
16961696
qua_u[0]->nam_c = strdup("namespace");
@@ -1787,7 +1787,11 @@ u3a_mark_road()
17871787
qua_u[13]->nam_c = strdup("timer stack");
17881788
qua_u[13]->siz_w = u3a_mark_noun(u3R->tim) * sizeof(c3_w);
17891789

1790-
qua_u[14] = NULL;
1790+
qua_u[14] = c3_calloc(sizeof(*qua_u[14]));
1791+
qua_u[14]->nam_c = strdup("ford memoization cache");
1792+
qua_u[14]->siz_w = u3h_mark(u3R->cax.for_p) * sizeof(c3_w);
1793+
1794+
qua_u[15] = NULL;
17911795

17921796
c3_w sum_w = 0;
17931797
for (c3_w i_w = 0; qua_u[i_w]; i_w++) {
@@ -1829,6 +1833,7 @@ u3a_rewrite_compact(void)
18291833
u3h_relocate(&(u3R->cax.har_p));
18301834
u3h_relocate(&(u3R->cax.per_p));
18311835
u3h_relocate(&(u3R->lop_p));
1836+
u3h_relocate(&(u3R->cax.for_p));
18321837
}
18331838

18341839
/* u3a_idle(): measure free-lists in [rod_u]

pkg/noun/allocate.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
/* u3a_vits: number of virtual bits in a noun reference gained via shifting
1515
*/
1616
#ifndef VERE64
17-
# define u3a_vits 2
17+
# define u3a_vits 2
18+
# define u3a_wits 0 // word-size: 0==32-bit, 1==64-bit
1819
#else
19-
# define u3a_vits 0
20+
# define u3a_vits 0
21+
# define u3a_wits 1 // word-size: 0==32-bit, 1==64-bit
2022
#endif
2123

2224
# define u3a_word_bytes (sizeof(c3_w))
@@ -298,6 +300,7 @@ STATIC_ASSERT( u3a_vits <= u3a_min_log,
298300
struct { // memoization caches
299301
u3p(u3h_root) har_p; // transient
300302
u3p(u3h_root) per_p; // persistent
303+
u3p(u3h_root) for_p; // ford
301304
} cax;
302305
} u3a_road;
303306
typedef u3a_road u3_road;
@@ -306,7 +309,7 @@ STATIC_ASSERT( u3a_vits <= u3a_min_log,
306309
*/
307310
enum u3a_flag {
308311
u3a_flag_sand = 1 << 1, // bump allocation (XX not impl)
309-
u3a_flag_cash = 1 << 2, // memo cache harvesting
312+
u3a_flag_cash = 1 << 2, // memo cache harvesting, flows forward
310313
};
311314

312315
/* u3a_pile: stack control, abstracted over road direction.

pkg/noun/build.zig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ pub fn build(b: *std.Build) !void {
183183
if (t.os.tag == .windows) {
184184
pkg_noun.addCSourceFiles(.{
185185
.root = b.path("platform/windows"),
186-
.files = &.{ "veh_handler.c", "rsignal.c" },
186+
.files = &.{ "veh_handler.c", "rsignal.c", "setjmp.c" },
187187
.flags = flags.items,
188188
});
189189
}
@@ -393,6 +393,8 @@ const c_source_files = [_][]const u8{
393393
"jets/tree.c",
394394
"jets/137/tree.c",
395395
"jets/136/tree.c",
396+
"jets/136/loot.c",
397+
"jets/135/tree.c",
396398
"log.c",
397399
"manage.c",
398400
"palloc.c",
@@ -418,6 +420,7 @@ const install_headers = [_][]const u8{
418420
"jets/k.h",
419421
"jets/q.h",
420422
"jets/w.h",
423+
"jets/136/w.h",
421424
"log.h",
422425
"manage.h",
423426
"nock.h",

pkg/noun/equality_tests.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ main(int argc, char* argv[])
157157

158158
// GC
159159
//
160-
u3m_grab(u3_none);
160+
u3m_grab();
161161

162162
fprintf(stderr, "test equality: ok\r\n");
163163
return 0;

pkg/noun/events.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -499,11 +499,10 @@ _ce_patch_verify(u3_ce_patch* pat_u)
499499
c3_y buf_y[_ce_page];
500500
c3_zs ret_zs;
501501

502-
if ( U3P_VERLAT != pat_u->con_u->ver_w ) {
503-
fprintf(stderr, "loom: patch version mismatch: have %"PRIc3_w", need %"PRIc3_w"\r\n",
504-
// XX: remove cast?
505-
(c3_w)pat_u->con_u->ver_w,
506-
(c3_w)U3D_VERLAT);
502+
if ( U3P_VERLAT != pat_u->con_u->ver_h ) {
503+
fprintf(stderr, "loom: patch version mismatch: have %u, need %u\r\n",
504+
pat_u->con_u->ver_h,
505+
U3P_VERLAT);
507506
return c3n;
508507
}
509508

@@ -729,7 +728,7 @@ _ce_patch_compose(c3_w max_w)
729728
_ce_patch_create(pat_u);
730729
len_w = sizeof(u3e_control) + (pgs_w * sizeof(u3e_line));
731730
pat_u->con_u = c3_malloc(len_w);
732-
pat_u->con_u->ver_w = U3P_VERLAT;
731+
pat_u->con_u->ver_h = U3P_VERLAT;
733732
pgc_w = 0;
734733

735734
for ( i_w = 0; i_w < max_w; i_w++ ) {

0 commit comments

Comments
 (0)