Skip to content

Deterministic symbol table on both x86 and arm64 - #269

Merged
robert3005 merged 2 commits into
developfrom
deterministic-symbol-table
Sep 2, 2026
Merged

Deterministic symbol table on both x86 and arm64#269
robert3005 merged 2 commits into
developfrom
deterministic-symbol-table

Conversation

@XiangpengHao

@XiangpengHao XiangpengHao commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Same training text will generate different symbol tables on x86 vs arm64.

The root cause is:

For speed, Rust's hash map checks slots in chunks using CPU vector instructions — and the chunk size is 16 slots at a time on Intel/AMD (SSE2) but 8 slots at a time on ARM (NEON).

Adding a third comparable makes sure that the symbols will never tie, i.e., a deterministic order regardless of the hash table implementation.

@codspeed-hq

codspeed-hq Bot commented Sep 1, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 14.31%

⚡ 2 improved benchmarks
✅ 28 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation decompress-into-reuse 1.3 µs 1.1 µs +14.64%
Simulation decompress-into-reuse 1.8 µs 1.6 µs +13.99%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing deterministic-symbol-table (a3eef94) with develop (3661dcf)

Open in CodSpeed

Comment thread src/builder.rs Outdated
@robert3005
robert3005 merged commit 3f9c7e0 into develop Sep 2, 2026
6 checks passed
@robert3005
robert3005 deleted the deterministic-symbol-table branch September 2, 2026 09:33
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