Extend Kangaroo search interval from 128-bit to 256-bit#2
Merged
Conversation
Co-authored-by: komyaka <34284729+komyaka@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Increase search interval from 125-bit to 256-bit
Extend Kangaroo search interval from 128-bit to 256-bit
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The search interval was limited to ~125-128 bits due to
int128_t(16-byte) fields inENTRY,DP, and network structures. This replaces them with a newint256_t(32-byte) type, enabling ranges up to 2^256 and rejecting anything larger.Core type change
ENTRYgrows from 32 → 64 bytes. Sign bit moves to bit255, kangaroo-type bit to bit254 ofd.Structural changes
int256_t x/dinENTRY;Convert()uses all 4 words;CalcDistAndType()decodes bit255/254;compare()/ duplicate-check use 4 words; all I/O sizes updated viasizeof(ENTRY)DPstruct usesint256_t; new magic numbersHEADW/HEADK/HEADKS = 0xFA6B8001/2/3(invalidates old 128-bit work files); function signatures updatedjumpBitcap raised 128 → 255;InitRange()rejectsrangePower > 256vector<int128_t>→vector<int256_t>; kangaroo packet sizes ×32; checksum and DP copy use all 4 wordsKSIZE10 → 12,ITEM_SIZE56 → 72 (kIdx shifts from offset 12 → 16 in output buffer)jD[NB_JUMP][4]; newAdd256macro;LoadKangaroos/StoreKangaroosupdated to slots 8-11 for distance, lastJump slot 10 → 12;OutputDPemits 8 distance wordsdist[GPU_GRP_SIZE][4];Add128→Add256SetParamscopies 4 words forjD;SetKangaroos/GetKangaroos/SetKangaroouse slots 8-11 for distance; output parsing reads 4 distance words#include <cstdint>)Original prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.