shred: schedule passes with Gutmann pass groups (genpattern) - #13699
shred: schedule passes with Gutmann pass groups (genpattern)#13699sankalpsthakur wants to merge 2 commits into
Conversation
Introduce a Pattern model with three repeating bytes and an optional sector-phase flag (pattern code bit 0x1000). Decode codes via Pattern::from_code; on write, XOR the first byte of every 512-byte sector with 0x80 and keep buffer offset locked so flips stay sector-aligned. Keep the existing pass schedulers for production behavior. Scheduler and distribution changes land in follow-up PRs.
Replace max(n/10,3)+cycle+shuffle for the default path with clean-room genpattern over PASS_GROUPS (group select, Bresenham random spacing, shuffle fixed patterns). Phase-variant codes enter the scheduled set. Keep create_test_compatible for --random-source until residual entropy lands so integration tests stay green.
Merging this PR will improve performance by 3.03%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | cksum_crc32b |
40.9 ms | 39.7 ms | +3.03% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing sankalpsthakur:fix/11611-shred-genpattern (4a28823) with main (bad4676)2
Footnotes
-
46 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
main(12eb3f4) during the generation of this report, so bad4676 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
Note that the format and comments here are clearly copied from GNU source source code: Unsure if it was you who wrote that or mechahitler [1]. [1] https://www.npr.org/2025/07/09/nx-s1-5462609/grok-elon-musk-antisemitic-racist-content |
Summary
Depends on #13694 (sector-phase patterns).
Default path uses clean-room
genpattern+PASS_GROUPS(Gutmann groups, Bresenham random spacing, fixed-pattern shuffle). Phase-variant codes can be scheduled.--random-sourcestill uses the legacy test-compatible sequence (dual path) so existing integration tests stay green. Residual-entropy scheduling is a follow-up.Not a GNU source port; clean-room from public algorithm description.
Tests
Structural genpattern unit tests only; exact GNU distribution matrix lands with residual entropy.
Assisted by Grok (xAI); reviewed and tested locally.