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.9 Stable)

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

Metric Current Observation Architectural Driver
Insert Throughput (wrapper microbench) ~850k ops/sec class Buffered batch writes + metadata-aware native canonicalization
Search Throughput (wrapper microbench) ~900k ops/sec class Fixed-depth traversal + native search path
Bulk Membership Throughput ~1.8M ops/sec class Batched contains path with amortized Python/C boundary cost
Memory Density Tracked at runtime via estimated_native_bytes / physical_nodes Real node bytes + active child arrays + pooled values
Space Efficiency 1,500x Reduction Global Atomic Pool Stealing & Merkle-DAG Folding

Benchmark note: Throughput is workload- and environment-dependent. Reproduce with python production_verdict_assessment.py --n 120000 --q 60000 --d 40000 --trials 2 --lqft-batch-size 4096.

🧠 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.9.tar.gz (17.9 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.9-cp312-cp312-win_amd64.whl (25.2 kB view details)

Uploaded CPython 3.12Windows x86-64

lqft_python_engine-1.0.9-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (70.7 kB view details)

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

lqft_python_engine-1.0.9-cp312-cp312-macosx_11_0_arm64.whl (23.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

lqft_python_engine-1.0.9-cp312-cp312-macosx_10_9_x86_64.whl (25.2 kB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

lqft_python_engine-1.0.9-cp311-cp311-win_amd64.whl (25.3 kB view details)

Uploaded CPython 3.11Windows x86-64

lqft_python_engine-1.0.9-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (71.4 kB view details)

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

lqft_python_engine-1.0.9-cp311-cp311-macosx_11_0_arm64.whl (23.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

lqft_python_engine-1.0.9-cp311-cp311-macosx_10_9_x86_64.whl (25.0 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

lqft_python_engine-1.0.9-cp310-cp310-win_amd64.whl (25.3 kB view details)

Uploaded CPython 3.10Windows x86-64

lqft_python_engine-1.0.9-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (70.2 kB view details)

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

lqft_python_engine-1.0.9-cp310-cp310-macosx_11_0_arm64.whl (23.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

lqft_python_engine-1.0.9-cp310-cp310-macosx_10_9_x86_64.whl (25.0 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: lqft_python_engine-1.0.9.tar.gz
  • Upload date:
  • Size: 17.9 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.9.tar.gz
Algorithm Hash digest
SHA256 76b98f0896d714fe71f70555866842cb869ac790d36b30a96d7ef5d9f4205a45
MD5 dae73ca0d3a4df848a48c430a99b3d99
BLAKE2b-256 343a8af45650266cbef592275f162a6ea99f08ea659eeb5c5537c2b383a7ddec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lqft_python_engine-1.0.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a618867a6783458dbe6f4a082efcd1649ef9b32790b63bed968a626ea7978ad0
MD5 9be1ae3f6f002c8b561c3f920219c2b9
BLAKE2b-256 8ed16a8e499dedb5b7ca26d149ca13037000ce4cc607a0d681dcb35a159ae945

See more details on using hashes here.

File details

Details for the file lqft_python_engine-1.0.9-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.9-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f1b87c438f29317f51597da880368886ea667f77132938e6747bea31a2885fe3
MD5 0f794f82bc4b74a1c42d70b5d5b84d37
BLAKE2b-256 73897bf1dcc17f36400839485556fc31da9dd29f9dafd7bfc090a8a6736772bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lqft_python_engine-1.0.9-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 116abfe6185ce16703f3aa8e04b21a4262865fffa567ecb58457f91b63483925
MD5 55a56c480e859ce1472c73ccfc2cbe64
BLAKE2b-256 b2c5d61394805c251d737e24e0960711f477bba37e5d6285deb1fab323188e47

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lqft_python_engine-1.0.9-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a3071beb707926a9bdc6b6c85868eebe48f6d8dfd15c87cc49df5d41e956e347
MD5 349880f8ed4b890b6459fff4c94b74a0
BLAKE2b-256 6dbe04c5cfd776a42156c188686031755f0a66b7201913010ccb3fa84fb594ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lqft_python_engine-1.0.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6d822fbdb2b1b61e13ecf8509a57910f017f89413f4bed4198592e3993b8d1ab
MD5 2706ae77c0d285a09f798adb3f7ace4c
BLAKE2b-256 21c06c15c92c18b35e5294edbda21be85388fa2eaaf12e1636ed2dd807de7e72

See more details on using hashes here.

File details

Details for the file lqft_python_engine-1.0.9-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.9-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5cd410a9c80ad6b1386d4c373b3a830747a457c6d50030a2e0f164934d31f91b
MD5 b04b25761cae5283792c7b30dcfe346f
BLAKE2b-256 b9c0c5207c1f3b4ed0282fc3d07c1b77e8cee2e953ddd1906867747f44c08c80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lqft_python_engine-1.0.9-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 13b0adee32c4cb182063efa0e9cabe49dce4cf8397dc738cb837e78fb53642db
MD5 a6313044e5cda7fb0bc6ffe140886c96
BLAKE2b-256 6c8ffc8b1389928864f1e09671ff878f0dd1df6beef12b1251b96b0121392931

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lqft_python_engine-1.0.9-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 84be9c70e75048532eba4f439daa1e32105569acc8cc69ffa521d1f2b1463cae
MD5 4e363d384587bd454ff1c682ec6e91a6
BLAKE2b-256 ce3f5674cfae45f8140f057eb0da4ea6b345fb95a561b11dbe13e67ffe22d754

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lqft_python_engine-1.0.9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ec5c48a873a2130cc37ac5a21f769a16d06c8c28c4314d89621697832e00388a
MD5 899e2b35d6b1d81af710a22959f69034
BLAKE2b-256 23f2ea3061f902bb0a461bef6fe432feeeea6b28e0a4bbd07fda5b29508787b8

See more details on using hashes here.

File details

Details for the file lqft_python_engine-1.0.9-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.9-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b8ade955f5df366ee4308151107054a02d41e3408c731e1a4e8ea37a98327f74
MD5 513c105a3a6d1ec0297026978b47077e
BLAKE2b-256 01051ce67b38653b159bfe47bea2082588c2c3c968ee6880f7013f397625742d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lqft_python_engine-1.0.9-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9df3d5d2b619297327b78e1fb77f17868f23ebb848f9c74ff6b50006fa019226
MD5 0d41ff362fbfecb831e1c58bbe857451
BLAKE2b-256 d477746cf0b4c27eec7e9e7edf68d1a2ad698a0b0c6a0136c3bf1ad473f2749a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lqft_python_engine-1.0.9-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ec346ab229e535dcb2fff41ac84fa2b0ee3e991fd1b99b1d4dfdcc80ad76a0c3
MD5 09729dd9e0c7a237e82caafe0959efa4
BLAKE2b-256 b424d58f784098f703fb52679547bc3114595d5c568ae9d19687c46d232c871b

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