Skip to content

Blake3 migration#1740

Open
Abrar Quazi (AbrarQuazi) wants to merge 6 commits into
masterfrom
blake3-migration
Open

Blake3 migration#1740
Abrar Quazi (AbrarQuazi) wants to merge 6 commits into
masterfrom
blake3-migration

Conversation

@AbrarQuazi
Copy link
Copy Markdown
Contributor

Updates our hashing algorithm from blake2b to blake3, which should lead to faster hashing performance: https://github.com/BLAKE3-team/BLAKE3. This will bring wake and RSC to utilize the same hashing algorithm.

Blake3 C and header files were taken from https://github.com/BLAKE3-team/BLAKE3/tree/master/c version: 1.8.2

Comment thread Makefile
$(patsubst %.cpp,%.o,$(COMMON_CPP)) $(patsubst %.c,%.o,$(COMMON_C))

# BLAKE3 platform detection
UNAME_M := $(shell uname -m)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This makefile, and the blake3.wake file, were changed according to the documentation on how to build for each platform: https://github.com/BLAKE3-team/BLAKE3/tree/master/c#building-manually

Comment thread src/runtime/schema.h
#define WAKE_SCHEMA_H

#define SCHEMA_VERSION "9"
#define SCHEMA_VERSION "10"
Copy link
Copy Markdown
Contributor Author

@AbrarQuazi Abrar Quazi (AbrarQuazi) Feb 6, 2026

Choose a reason for hiding this comment

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

Even if the schema wasn't manually updated, i will still consider this a bump to the schema version since the underlying file hashes has changed

{9, 10,
[](sqlite3* db) -> bool {
(void)db; // unused
std::cerr << std::endl;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think users can really migrate to this newest DB version, without starting a fresh wake.db

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.

Certainly not if we want to drop blake2 support :).

We /could/ support this if we wanted -- promote to one of the schemes (maybe like SRI hashes) that specifies the hash kind with the hash value/result, but I'm on board with the break. Just saying it's not necessary, but also without costs of course.

Copy link
Copy Markdown
Contributor

@dtzSiFive Will Dietz (dtzSiFive) left a comment

Choose a reason for hiding this comment

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

LGTM, nice!

I did not review the contents of the blake3 directory, I assume it was almost entirely (other than blake3.wake) imported from a release tarball (or equivalent).

Do we want / need to sort out how to enable vector support for x86_64 (probably essentially all of our users), conceivably dynamically detecting feature support?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

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.

3 participants