Commit Graph

18381 Commits

Author SHA1 Message Date
Midlyx Hatrys
45b28a49ed add a devshell for NixOS
Bazel on NixOS is problematic -- it's packaged, but not patched to
actually _work_ outside of FHS environments.

Vere build system presents an additional accidental hurdle: it expects
the musl-cross-make toolchain to be under /usr/local/<target> and uses
sudo to install it there, as one does.  Unfortunately NixOS nerfs sudo
in user namespaces (which are used to implement FHS environments) for
security reasons, making it impossible to install the toolchain the
normal way.

So in order to restore the ability to build Vere under NixOS without
resorting to containers (which is unsporting), this commit adds a
flake, which defines a devshell, which provides the toolchain and all
the other needed tools.  So one can "nix develop", go get
coffee (first invocation may take 15 minutes or so, subsequent ones
will be instant until next nix store GC), and then "bazel build
:urbit" etc.
2023-03-01 09:50:14 +02:00
Midlyx Hatrys
3e3746d601 patch secp256k1 to make sure it's libtoolized
Having "libtoolize --copy --force" first thing in "autogen.sh" is a
totally normal thing people do, it is supposedly harmless and
idempotent, no idea why lack thereof is apparently only problematic on
NixOS.

So: when running on NixOS, libtoolize.
2023-03-01 09:50:14 +02:00
Ted Blackman
9453ce6f2a
bump version to v2.0 (#271) 2023-02-28 17:39:43 -05:00
Matthew LeVan
42521c8210 bump version to v2.0 2023-02-28 16:29:49 -06:00
Matthew LeVan
2f5a8bbbe0
build: upload soon and edge tags to dockerhub (#258)
Resolves #160

Adds a job which will push a tag with the pace value to DockerHub.
Technically also adds a `live` tag which references the same image as
the `latest` tag.
2023-02-28 16:25:05 -06:00
Matthew LeVan
f0204ac218
Merge master v1.22 into develop (#268) 2023-02-28 16:04:10 -06:00
Ted Blackman
c8be121455
Pointer Compression to enable 8G Loom (#164)
### Description

Resolves #163

In fulfillment of https://urbit.org/grants/loom-pointer-compression

### Benchmark

#### Basic brass pill fakezod boot benchmark - x86_64 linux

Pay primary attention to `Elapsed (wall clock) time`, `Maximum resident
set size
(kbytes)` and `Major (requiring I/O) page faults`

##### Takeaway

We expected increased memory usage because this is naturally a tradeoff
of
alignment. Do note, that runs (2) and (3) included changes to align the
_stack_
as well as the _heap_. In the run without stack alignment (4) you can
see that
stack alignment has no effect on max RSS -- at least when booting from a
pill. From some basic evaluation in gdb I've done in the past, I expect
stack
usage when DWORD-aligned to increase by ~50% (rather than a theoretical
100%). Stack usage is quite small compared to heap usage however, so you
shouldn't expect to see this reflected in maximum RSS. Overall maximum
resident
memory increased by about ~33%.

The number of major pagefaults encountered during a brass boot is
roughly equal
to prior.

The elapsed (wall clock) time difference between (2) and (3) is
essentially
zero. There is essentially no performance gained by the virtual bit size
being a
compile-time constant.

There is a small latency cost in the current DWORD-aligned heap
allocation
implementation as compared to a runtime that doesn't require allocations
to be
aligned. Compare the elapsed times of (1) -- 2:21.09 or 141.09 s -- and
(2) --
2:23.50 or 143.50 s -- result: ~1.7% increased latency. If you look at
run (4)
however, which excluded stack alignment changes -- 2:22.55 or 142.55 s
--, we
split the difference at ~1.0% increased latency. Note, this _is_
repeatable and
the 1% difference isn't random. Running the same program over again on
the same
system exhibits tiny variance.

##### 1) -O3 no pointer compression vere/develop

A run from the HEAD of vere/develop

commit 7c890c3350

```
Command being timed: "./urbit -t -q -F zod -B brass.pill -c zod"
User time (seconds): 1.25
System time (seconds): 0.03
Percent of CPU this job got: 0%
Elapsed (wall clock) time (h:mm:ss or m:ss): 2:21.09
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 148036
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 3492
Minor (reclaiming a frame) page faults: 6188
Voluntary context switches: 68
Involuntary context switches: 5
Swaps: 0
File system inputs: 14866
File system outputs: 21544
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
```

##### 2) -O3 compiletime determined virtual bit size
i/163/pointer-compression

State of pointer compression work prior to migration (where concessions
to
runtime determined virtual bit size were made)

commit 4083f1c660

```
Command being timed: "./urbit -t -q -F zod -B brass.pill -c zod"
User time (seconds): 1.39
System time (seconds): 0.04
Percent of CPU this job got: 1%
Elapsed (wall clock) time (h:mm:ss or m:ss): 2:23.50
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 197176
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 3487
Minor (reclaiming a frame) page faults: 6219
Voluntary context switches: 68
Involuntary context switches: 2
Swaps: 0
File system inputs: 14866
File system outputs: 21544
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
```

##### 3) -O3 runtime determined virtual bit size
i/163/pointer-compression

Current state of pointer compression work -- after implementation of
migration
and runtime determined virtual bit size concession

commit 8dffe067e1:

```
Command being timed: "./urbit -t -q -F zod -B brass.pill -c zod"
User time (seconds): 1.40
System time (seconds): 0.06
Percent of CPU this job got: 1%
Elapsed (wall clock) time (h:mm:ss or m:ss): 2:23.52
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 197200
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 3489
Minor (reclaiming a frame) page faults: 7242
Voluntary context switches: 69
Involuntary context switches: 4
Swaps: 0
File system inputs: 14866
File system outputs: 21544
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
```

##### 4) -O3 runtime determined virtual bit size _WITHOUT_ stack
alignment barter-simsum/pointer-compression-no-align-stack

commit 8b0438ab3b

```
Command being timed: "./urbit -t -q -F zod -B brass.pill -c zod"
User time (seconds): 1.42
System time (seconds): 0.06
Percent of CPU this job got: 1%
Elapsed (wall clock) time (h:mm:ss or m:ss): 2:22.55
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 197204
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 3492
Minor (reclaiming a frame) page faults: 6221
Voluntary context switches: 68
Involuntary context switches: 3
Swaps: 0
File system inputs: 14866
File system outputs: 21544
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
```

##### FINAL BENCHMARK BEFORE MERGE:

This was run after some fairly significant changes to minimize malloc
padding,
fix memory corruption when run with `U3_MEMORY_DEBUG`, and more.

It was agreed to keep stack alignment out of this PR as it currently
isn't used
and costs us a bit of latency.

Runtime vs compiletime determined pointer compression still shows no
latency
difference on the x86 linux machine tested (ddr4 memory). On an m2 mac
air,
there _was_ a 5% latency increase from compiletime to runtime pointer
compression. This may be fixed later and would not necessitate another
migration.

The additional free list sanity checking done in `u3a_loom_sane`
introduces
negligible latency in `u3e_save`. On a relatively fragmented heap, it
only takes
60ms to complete. This will be kept in order to detect _some_ memory
corruption
if it occurs and prevent that corruption from propagating to disk.

A brass pill boot was performed off of
13e0b43d8da4bdd318fcd4e3d3610caa3af4608a. Observe there is no regression
in the
Elapsed (wall clock) time statistic. Further, the maximum resident set
size has
been reduced by 25% back to its pre pointer compression size (150M).
This is
likely due to a decrease in the average allocation's padding.

Lastly, total sweep size was compared between a freshly booted pier
without
pointer compression and with pointer compression post migration. There
is no
noticeable increase in the overall size of allocations.

```
Command being timed: "./burbit -t -q -F zod -B brass.pill -c brasspillbench"
User time (seconds): 1.27
System time (seconds): 0.04
Percent of CPU this job got: 0%
Elapsed (wall clock) time (h:mm:ss or m:ss): 2:21.49
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 150088
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 3490
Minor (reclaiming a frame) page faults: 6188
Voluntary context switches: 64
Involuntary context switches: 4
Swaps: 0
File system inputs: 14866
File system outputs: 21544
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
```
2023-02-28 15:56:25 -05:00
barter-simsum
c08ada2524 u3a_loom_sane() 2023-02-28 12:07:37 -05:00
barter-simsum
65328d762a misc. 2023-02-28 12:07:37 -05:00
barter-simsum
ba1b0f1e3d refactor alignment functions 2023-02-28 12:07:37 -05:00
barter-simsum
953b21ae82 fix U3_MEMORY_DEBUG corruption. Minimize required padding
pad malloc internal pad calculations were largely responsible for the
corruption. It happened to be the case that without U3_MEMORY_DEBUG set (which
doubles the size of a `u3a_box`), we overallocated just enough memory for the
pad miscalculation to not effect us.

This fixes both the overallocation and the pad miscalculation.
2023-02-28 12:07:37 -05:00
barter-simsum
c71060be84 (ALLO, ALHI) -> (C3_ALGHI, C3_ALGLO) 2023-02-28 12:07:37 -05:00
barter-simsum
45217c3409 factor out _me_align_(pad|dap) and all instances of alp_w
This drastically simplifies the bizarre (ald_w, alp_w) alignment logic which
also seems to have been the cause of issues with heap corruption originating in
handling of internal 16 byte alignment by _ca_box_make_hat
2023-02-28 12:07:37 -05:00
barter-simsum
be4b92b38b cenums are dumb 2023-02-28 12:07:37 -05:00
barter-simsum
ef2c4bba4d introduce vere/version.h
version numbers - currently for u3e and u3v - should be kept in their own header
to avoid dependency loops since anything should be able to source these.

I would like to avoid literal comparison like:

if (ver_w == 2) { }

and instead opt for

if (ver_w == U3V_VER2) { }

or

if (ver_w == U3V_LATEST) { }

Though this may seem overkill at first given the only version we've incremented
is u3H->ver_w, this is the simplest solution to avoid dependency loops
2023-02-28 12:07:37 -05:00
barter-simsum
98ef6582f6 paren wrap road argument in road macros u3a_open, u3a_full, etc 2023-02-28 12:07:37 -05:00
barter-simsum
48e326ff03 loom migration to support compressed pointers 2023-02-28 12:07:37 -05:00
barter-simsum
0966fb0195 fix patch control version var name pat_u->con_u->ver_y -> ver_w 2023-02-28 12:07:37 -05:00
barter-simsum
8c0cc71127 specify up to 33 bits (8G) with --loom
Unsure how we should ultimately do this. Specifying 33 bits should be
conditional on the loom having compressed pointers obviously.

P.S. Having implemented the migration by now, the migration is not optional, so
this is fine.
2023-02-28 12:07:37 -05:00
Josh Lehman
97fe05e7b1
Release v1.22 (#264) 2023-02-28 13:04:47 -03:00
Ted Blackman
1ee288f9ca
gh: remove build/ci-specific codeowners (#266)
Resolves #265.
2023-02-28 10:57:53 -05:00
Matthew LeVan
ccdb6c708b gh: remove build/ci-specific codeowners 2023-02-28 09:51:24 -06:00
Matthew LeVan
fc4a416e09
path correction: tloncorp/urbit ➞ tloncorp/vere (#262)
_Ask yourself whether the dream of heaven and greatness should be
waiting for us in our graves — or whether it should be ours here and now
and on this earth._
2023-02-28 08:10:46 -06:00
Alex Shelkovnykov
4057f8e5e3 build: upload soon and edge tags to dockerhub 2023-02-27 23:39:51 +01:00
del-distributed
cfdc3e3ad6
path correction: tloncorp/urbit ➞ tloncorp/vere
Ask yourself whether the dream of heaven and greatness should be waiting for us in our graves — or whether it should be ours here and now and on this earth.
2023-02-27 17:36:32 +04:00
barter-simsum
b5bef4fc09 refactor _ce_patch_verify -- use new PRIc3... printf specifiers 2023-02-25 16:14:09 -05:00
barter-simsum
c93ef2e82c fix snapshot crashes caused by > (2^32) addressable bytes in loom
Changes in next/vere also fixed this. This is nearly a subset of those changes.
2023-02-25 16:14:09 -05:00
barter-simsum
fbf69a018e prevent overflow when printing memory with |mass
Previously, anything above 4G would overflow and print as less memory
2023-02-25 16:14:09 -05:00
barter-simsum
6c36069749 golf u3r_met -- also fixes failing STATIC_ASSERT after 8G expansion
I'm assuming the old switch-case was an attempted performance optimization -
more constants with math that could be elided by the compiler, e.g.

`if (gal_w > (UINT32_MAX - 35 >> 5))`.

However, looking at -O3 disassembly, I really doubt it's any faster. There are
at least as many conditional jumps and the instruction size is about 2x larger.

===

Moreover, this change does not artificially limit the size that gal_w can
be. For instance, in the previous implementation, for a value of a_y=2, gal_w
could not exceed the following without bailing:

`(UINT32_MAX - 35) >> 5` =>
`0x07FFFFFF`

Now, gal_w cannot exceed

`((UINT32_MAX - (32 + max_y)) >> (5 - a_y))` =>
`((UINT32_MAX - 35) >> 3)` =>
`0x1FFFFFFF`

===

This has been confirmed to return exactly the same results as prior
2023-02-25 16:14:09 -05:00
barter-simsum
cea338ce27 4G -> 8G loom 2023-02-25 16:14:09 -05:00
barter-simsum
8413fddb33 pointer compression on 4G loom 2023-02-25 16:14:09 -05:00
barter-simsum
d6261e914f DWORD aligned heap allocs 2023-02-25 16:14:09 -05:00
barter-simsum
abfd14c72a make u3a_[into|outa|to[off|ptr|wtr]] macros inline funcs 2023-02-25 16:14:09 -05:00
barter-simsum
bcac1d6d24 misc. semantically inconsequential 2023-02-25 16:14:07 -05:00
Ted Blackman
9218e0cb05
error when creating pier and -c unspecified. Exception: -w and -F (#254)
-w and -F to continue with previous behavior of implicit pier creation.

Resolves #190
2023-02-24 17:52:23 -05:00
barter-simsum
c552b1a468 error when creating pier and -c unspecified. Exception: -w and -F
-w and -F to continue with previous behavior of implicit pier creation.
2023-02-23 09:32:51 -05:00
Ted Blackman
c1a83b3fde
Clarify release instructions (#251)
Resolves #246.
2023-02-22 10:00:28 -05:00
Ted Blackman
73784ff4a6
remove .RELEASE_DESCRIPTION.md (#241)
Resolves #240.
2023-02-22 09:59:30 -05:00
Ted Blackman
ee67742eb9
Merge develop v1.22 into release (#252) 2023-02-21 15:46:23 -05:00
Matthew LeVan
f2df391ade
Merge master v1.21 into develop (#250) 2023-02-21 15:03:29 -05:00
Matthew LeVan
4a2f3c10f3 docs: improve version bump instructions for release days 2023-02-21 14:58:14 -05:00
Matthew LeVan
cf345098e3 docs: update develop -> release merge instructions 2023-02-21 14:56:22 -05:00
Matthew LeVan
d8b7ba5943 docs: update master -> develop merge instructions 2023-02-21 14:48:13 -05:00
Matthew LeVan
8f46e1672c Revert "restore correct VERSION"
This reverts commit 31ec04083c.
2023-02-21 14:32:41 -05:00
Matthew LeVan
b8cf5377a0
Revert "Automatically create GH releases (and corresponding tags) (#1… (#244)
Reverting this commit since `gh` is not installed on local arm64 linux
box.
2023-02-21 13:37:51 -05:00
barter-simsum
37726e67f5 Revert "Automatically create GH releases (and corresponding tags) (#136)"
This reverts commit dff7b44ee5, reversing
changes made to 1d31ad909c.
2023-02-21 13:22:54 -05:00
Matthew LeVan
98f982c5f9
CI: add GH_TOKEN (#243)
Resolves #242.
2023-02-21 12:33:38 -05:00
Matthew LeVan
c59ea0ddf4 CI: add GH_TOKEN 2023-02-21 12:30:06 -05:00
Matthew LeVan
1d52a99bc9
Release v1.21 (#239) 2023-02-21 12:19:36 -05:00
Matthew LeVan
9ddaf5f2e5 remove .RELEASE_DESCRIPTION.md 2023-02-21 09:12:59 -05:00