Repository navigation
feat(tensor): HissReshaper pure-binary QTT with reversible index mapping (STUB #254) - #5112
Merged
Merged
Conversation
4 tasks
…ping (STUB #254) Agent-Logs-Url: https://github.com/makr-code/ThemisDB/sessions/74a3c87c-90f8-4f7f-846f-228b34b97d23 Co-authored-by: makr-code <[email protected]>
Copilot
AI
changed the title
[WIP] Implement pure-binary QTT with reversible index mapping
feat(tensor): HissReshaper pure-binary QTT with reversible index mapping (STUB #254)
May 13, 2026
makr-code
marked this pull request as ready for review
May 13, 2026 18:59
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.
HissReshaper::exposeQuantics()produced a valid pure-binary padded-QTT layout but exposed no way to convert between flat physical indices (original unpadded tensor) and flat QTT indices (all-2 quantics-mode tensor), making lossless roundtrips and padding detection impossible for callers.Changes
include/tensor/hiss_structural_search.hQTTMappingDescriptorstruct:physicalToQTT(size_t) → size_t— O(D·B), MSB-first bit encoding per dimensionqttToPhysical(size_t) → optional<size_t>— inverse;std::nulloptfor zero-padded QTT slotsQTTraingainsmapping: QTTMappingDescriptorfield (always populated by built-in path)QuanticsFndocs note custom backends must populatemappingthemselvessrc/tensor/hiss_structural_search.cppexposeQuantics()now fillsqt.mappingafter decompositionquanticsFactors()helper (residual-factor approach, never called)tests/test_tensor_hiss_structural_search.cppSix new tests (THSS-14 – THSS-19):
[3,5]→[4,8]: all 15 physical indices round-trippadded – physicalslots returnnulloptexposeQuantics()populatesmappingfields consistently with QTTrain metadataExample usage
QTTrain qtt = HissReshaper::exposeQuantics(train, {3, 5}); // qtt.mapping.grid_sizes == {3, 5} // qtt.mapping.padded_grid_sizes == {4, 8} // qtt.mapping.bit_depths == {2, 3} size_t qtt_idx = qtt.mapping.physicalToQTT(7); // {1,2} → bit-packed QTT flat idx auto phys = qtt.mapping.qttToPhysical(qtt_idx); // == 7 auto padding = qtt.mapping.qttToPhysical(31); // == nullopt (padding slot)Linked Issues
Closes #254
Type of Change
Breaking Change Checklist
VERSIONandCMakeLists.txtdocs/migration/### Removed/### Changedsection updatedTesting
📚 Research & Knowledge (wenn applicable)
/docs/research/angelegt?/docs/research/implementation_influence/eingetragen?Relevante Quellen:
AI-Generated Code (KI-generierter Code)
GetSymbolReferences_CppToolsgeprüft (siehe.github/instructions/cpp-language-service-tools.instructions.md)new/deleteohne explizites Review eingeführtconst, exception-safe, no resource ownershipChecklist
include/tensor/README.mdupdated;src/STUB_INVENTORY.mdentry 254 updated[Unreleased]