Skip to main content

LQFT Engine: native C extension with bounded-depth lookups and structural sharing

Project description

Log-Quantum Fractal Tree (LQFT) 🚀

Python 3.12 C-Engine Concurrency Architecture License

📌 Project Overview

The Log-Quantum Fractal Tree (LQFT) is a high-performance, scale-invariant data structure engine designed for massive data deduplication and persistent state management. Synthesizing Hash Array Mapped Trie (HAMT) routing with Merkle-DAG structural folding, the LQFT provides deterministic $O(1)$ search latency and sub-linear $O(\Sigma)$ space complexity.

Status: Code Frozen (March 2026) for the BFS/DFS Visual Mastery Sprint.


🏆 Performance Snapshot (v1.0.8 Stable)

Verified Environment: Python 3.12 | MSYS2/MinGW64 GCC -O3 | 16-Core Physical Affinity

Metric Current Observation Architectural Driver
Insert Throughput (wrapper microbench) ~600k ops/sec class Buffered batch writes + native C bulk path
Search Throughput (wrapper microbench) ~900k ops/sec class Fixed-depth traversal + native search path
Memory Density ~104 Bytes / Node NUMA-Aware Slab Allocator (Background Daemon)
Space Efficiency 1,500x Reduction Global Atomic Pool Stealing & Merkle-DAG Folding

Benchmark note: Throughput is workload- and environment-dependent. Use the repo benchmark scripts to reproduce numbers for your hardware.

🧠 Core Architecture

1. Hardware Synchronization (Thread Affinity & NUMA)

The LQFT explicitly pins OS threads to physical CPU cores to prevent scheduler migrations, guaranteeing that hot memory paths remain in the L1/L2 cache. Memory is mapped using MAP_POPULATE and VirtualAlloc to guarantee NUMA-local hardware proximity.

2. Lock-Free Search & Optimistic Concurrency

Read operations are 100% lock-free (RCU-inspired). Threads traverse the trie without acquiring mutexes or triggering atomic cache-line invalidations. Deallocations are deferred to Thread-Local Retirement Chains, eliminating global contention.

3. Scale-Invariant Big-O Complexity

The LQFT utilizes a fixed 64-bit hash space partitioned into 13 segments.

  • Time Complexity: $O(1)$ — Every traversal requires exactly 13 hardware instructions.
  • Space Complexity: $O(\Sigma)$ — Identical branches are folded into single pointers, mapping physical space to data entropy rather than data volume.

🛠️ Getting Started

Installation

The engine requires a C compiler (GCC/MinGW or MSVC) to build the native extension.

# Clone the repository
git clone [https://github.com/ParjadM/Log-Quantum-Fractal-Tree-LQFT-.git](https://github.com/ParjadM/Log-Quantum-Fractal-Tree-LQFT-.git)
cd Log-Quantum-Fractal-Tree-LQFT-

# Build the native C-extension with highest hardware optimizations
python setup.py build_ext --inplace

The FFI Bridge (Python)

The core engine handles massive state spaces seamlessly behind a high-level wrapper.

import lqft_c_engine

# High-Speed Zero-Copy Batching
# Send raw C-arrays directly to the engine to bypass the GIL entirely
lqft_c_engine.insert_batch_raw(bytes(raw_buffer_array), "enterprise_payload")

# Native Search (throughput depends on workload/profile)
result = lqft_c_engine.search(0x123456789ABCDEF)

# Fetch internal hardware metrics
metrics = lqft_c_engine.get_metrics()
print(metrics['physical_nodes']) 

⚖️ License

MIT License - Parjad Minooei (2026).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lqft_python_engine-1.0.8.tar.gz (17.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

lqft_python_engine-1.0.8-cp312-cp312-win_amd64.whl (22.9 kB view details)

Uploaded CPython 3.12Windows x86-64

lqft_python_engine-1.0.8-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (64.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

lqft_python_engine-1.0.8-cp312-cp312-macosx_11_0_arm64.whl (21.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

lqft_python_engine-1.0.8-cp312-cp312-macosx_10_9_x86_64.whl (21.3 kB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

lqft_python_engine-1.0.8-cp311-cp311-win_amd64.whl (22.9 kB view details)

Uploaded CPython 3.11Windows x86-64

lqft_python_engine-1.0.8-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (65.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

lqft_python_engine-1.0.8-cp311-cp311-macosx_11_0_arm64.whl (21.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

lqft_python_engine-1.0.8-cp311-cp311-macosx_10_9_x86_64.whl (21.3 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

lqft_python_engine-1.0.8-cp310-cp310-win_amd64.whl (22.9 kB view details)

Uploaded CPython 3.10Windows x86-64

lqft_python_engine-1.0.8-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (64.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

lqft_python_engine-1.0.8-cp310-cp310-macosx_11_0_arm64.whl (21.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

lqft_python_engine-1.0.8-cp310-cp310-macosx_10_9_x86_64.whl (21.3 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

Details for the file lqft_python_engine-1.0.8.tar.gz.

File metadata

  • Download URL: lqft_python_engine-1.0.8.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lqft_python_engine-1.0.8.tar.gz
Algorithm Hash digest
SHA256 8c891463f620e7fa089fd468b5e788d8bd5d20a218ea66ec3eabe21179f4dec2
MD5 9328ed42ab71e705c033ec22f5e53a70
BLAKE2b-256 8f120b8408d52248846b64b04afa1a1cce5c52870b9789f8b6036fadd87213e1

See more details on using hashes here.

File details

Details for the file lqft_python_engine-1.0.8-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-1.0.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5b4448d35873f1315a2f482ace65fc4164d6c501ffb1e6434417a7ff8ca0061c
MD5 a1ee69b23424ff3682b817ceaddd325b
BLAKE2b-256 7c2c0295e34a22d5ac77d1c377078f6b0e35beac34360c26eb41a4a99ab2a6ce

See more details on using hashes here.

File details

Details for the file lqft_python_engine-1.0.8-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-1.0.8-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 199c9c59fd8002e3d4332c6d330f0e6873d52afcf2d884c5dc147d16508fb900
MD5 a41d83c45326f5924b41018207e50452
BLAKE2b-256 3053edf40b293dbfee94a56185b5139053fd80fc623f7241dad8aa9d4dd7153f

See more details on using hashes here.

File details

Details for the file lqft_python_engine-1.0.8-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-1.0.8-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2b4fbf7de199bf34560d0e54a4db786c953e272263739fa111ea91b7a4e29f73
MD5 c66b43b5b23ff26f3244b4aa9fe0b7a8
BLAKE2b-256 85cd722163bda0b50ca9cbe035a0ce6f1a5ff858a1ff08fca024564e6ce5c85c

See more details on using hashes here.

File details

Details for the file lqft_python_engine-1.0.8-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-1.0.8-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 67946874e7a71f408f81bb590880c6114d70e43236420ed73318ae1cdbb04c19
MD5 871778f16716bd01882d6c3135791de6
BLAKE2b-256 b5cf43ba144fd45ced923df368fb710371fe0f3b328bf4273cf1f80246143815

See more details on using hashes here.

File details

Details for the file lqft_python_engine-1.0.8-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-1.0.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 22d3a0c4ea9870d02a409c05ce757709ffb13269df470373e5ae5998de8254e6
MD5 1ad82c647a7497a114fc8d3d50087d92
BLAKE2b-256 2bc392a27c4351656d76c711db2502f95e9d16a34f11883d829bc6fb898eddbb

See more details on using hashes here.

File details

Details for the file lqft_python_engine-1.0.8-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-1.0.8-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c87cc436ec1b221e5d026e649cae606854e2ff505e40efb0c7e15bd0cd16d7c5
MD5 95a735481982e2970a8b960093c12b3d
BLAKE2b-256 61979d00f60c9786c7914a84ceccd3b0c75347b3a2f68edc620f7e5a9dd02203

See more details on using hashes here.

File details

Details for the file lqft_python_engine-1.0.8-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-1.0.8-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 de56607003eacbac609aa55d341803c7e6bf0b0c777d79406afc43530a1bddcf
MD5 75f03a88bced06ffa9da9c21800020c0
BLAKE2b-256 f656d99248162ca951f2f5255052d6d34322bfed7a4a521537b49c9a0ce08770

See more details on using hashes here.

File details

Details for the file lqft_python_engine-1.0.8-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-1.0.8-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6084e30fd7f48cd9c7d6ddbfaf774c7d120e3150812187cf88baacb0b022152c
MD5 586056eb8909b02c1df2f1c426fd077e
BLAKE2b-256 a92c4ce42440b0290779d6eb4740efcd6639420a1509864c2d26c0701fb442f4

See more details on using hashes here.

File details

Details for the file lqft_python_engine-1.0.8-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-1.0.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b45553e6e1e91c9343b7c2273e5d1932395805d25cd7a2ebb7c98bd08be62ffe
MD5 edb0f1558821a815c1393857802b03ce
BLAKE2b-256 fed059827a99e8c5d3e4776b28b901318cd6bfa73c4b7b2c43e60881583cd487

See more details on using hashes here.

File details

Details for the file lqft_python_engine-1.0.8-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-1.0.8-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 533fc8b4f2dbe4a77477ae479ae303850a8f2797e7f801f97e320ceabc10da9d
MD5 4ed2d97fc4daea3adfec8514360fd139
BLAKE2b-256 8f1065e42160ed302a7d5e79c53b8956487c3b1e278d47fc2e572d19601c01e8

See more details on using hashes here.

File details

Details for the file lqft_python_engine-1.0.8-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-1.0.8-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d68d9098ac6fdcde4e86d9041f24f4e00e37b195ffcffbcfce8c7c4caf64bfd4
MD5 74b57c87b094363d0e1a6970ccebcabf
BLAKE2b-256 82a6e630e96728a0768fcb91f3ddc191f281f03b73098f8348e7b9d5de1a22fe

See more details on using hashes here.

File details

Details for the file lqft_python_engine-1.0.8-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-1.0.8-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3671cecaffa52f3978f326b12cb480fafc73893f7ccbbc4530c19c27cbc86f5f
MD5 6966bf5dc20f68d30cfaccb71aab36d5
BLAKE2b-256 e358bd3106e830809b04dcd9ea61b39fbf9ad5594a7c7885a0db7b4e72d6d909

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page