[PR #868] [MERGED] Change hand-picked RNGs back to SmallRng #1123

Closed
opened 2026-02-27 20:01:15 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/868
Author: @roderickvd
Created: 10/21/2021
Status: Merged
Merged: 10/21/2021
Merged by: @roderickvd

Base: devHead: smallrng-dither


📝 Commits (1)

  • ff36484 Change hand-picked RNGs back to SmallRng

📊 Changes

3 files changed (+7 additions, -34 deletions)

View changed files

📝 Cargo.lock (+0 -10)
📝 playback/Cargo.toml (+1 -2)
📝 playback/src/dither.rs (+6 -22)

📄 Description

I misread the paper and it's better to just stick to what SmallRng uses by default. It's easier on the eyes, too.

  • While Xoshiro256Plus is faster on 64-bit, it has low linear complexity in the lower three bits, which are used when generating dither (I thought only Xoroshiro128 had low linear complexity, and I was wrong).

  • And on 32-bit, while Xoshiro128StarStar access one less variable from the heap than Xoshiro128PlusPlus, multiplication is generally slower than addition in hardware.

Sorry for the noise.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/librespot-org/librespot/pull/868 **Author:** [@roderickvd](https://github.com/roderickvd) **Created:** 10/21/2021 **Status:** ✅ Merged **Merged:** 10/21/2021 **Merged by:** [@roderickvd](https://github.com/roderickvd) **Base:** `dev` ← **Head:** `smallrng-dither` --- ### 📝 Commits (1) - [`ff36484`](https://github.com/librespot-org/librespot/commit/ff3648434b5a8275a30d1bf1c86191a79b146c66) Change hand-picked RNGs back to `SmallRng` ### 📊 Changes **3 files changed** (+7 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+0 -10) 📝 `playback/Cargo.toml` (+1 -2) 📝 `playback/src/dither.rs` (+6 -22) </details> ### 📄 Description I misread the [paper](https://vigna.di.unimi.it/papers.php#BlVSLPNG) and it's better to just stick to what `SmallRng` uses by default. It's easier on the eyes, too. * While `Xoshiro256Plus` is faster on 64-bit, it has low linear complexity in the lower three bits, which *are* used when generating dither (I thought only `Xoroshiro128` had low linear complexity, and I was wrong). * And on 32-bit, while `Xoshiro128StarStar` access one less variable from the heap than `Xoshiro128PlusPlus`, multiplication is generally slower than addition in hardware. Sorry for the noise. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:01:15 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#1123
No description provided.