<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Priyadarshan Singh</title>
    <description>The latest articles on DEV Community by Priyadarshan Singh (@pdrojack).</description>
    <link>https://dev.to/pdrojack</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F276613%2F4c2412c6-e946-4ff2-9b5a-85bddb3904ce.png</url>
      <title>DEV Community: Priyadarshan Singh</title>
      <link>https://dev.to/pdrojack</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pdrojack"/>
    <language>en</language>
    <item>
      <title>How Cilium Cut Restart Times by Reusing Compiled BPF Objects</title>
      <dc:creator>Priyadarshan Singh</dc:creator>
      <pubDate>Mon, 02 Nov 2026 13:04:43 +0000</pubDate>
      <link>https://dev.to/pdrojack/how-cilium-cut-restart-times-by-reusing-compiled-bpf-objects-3o3k</link>
      <guid>https://dev.to/pdrojack/how-cilium-cut-restart-times-by-reusing-compiled-bpf-objects-3o3k</guid>
      <description>&lt;h1&gt;
  
  
  How Cilium Cut Restart Times by Reusing Compiled BPF Objects
&lt;/h1&gt;

&lt;p&gt;If you’ve ever worked with eBPF programs in production, you know that compiling them can be a time-consuming bottleneck, especially during restarts. In Cilium, a popular networking and security project, the agent used to recompile all BPF programs from scratch on every restart. This led to delays stretching into minutes and even caused missed regeneration deadlines in continuous integration (CI) environments.&lt;/p&gt;

&lt;p&gt;In this article, we’ll explore the root cause of this inefficiency, the technical details of the caching solution introduced, and the broader engineering lesson about build artifact reuse.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem: Unnecessary Recompilation on Every Restart
&lt;/h2&gt;

&lt;p&gt;Cilium’s agent manages a set of BPF programs that it compiles using clang. Before the change, each time the agent restarted, it triggered a full recompilation of all BPF programs. This was painfully slow — in some cases, endpoint template compilations took up to 553 seconds.&lt;/p&gt;

&lt;p&gt;Why did this happen? Because the agent had no way to detect if the BPF source code or its build environment had changed since the last compilation. Without such detection, it always assumed it needed to recompile everything.&lt;/p&gt;

&lt;p&gt;This behavior caused two main issues:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Long startup delays:&lt;/strong&gt; Developers and CI pipelines had to wait for lengthy recompilations even if nothing changed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Missed deadlines:&lt;/strong&gt; In CI, where quick feedback loops matter, these delays led to missed regeneration deadlines and slowed down testing.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Root Cause: Lack of Input Hashing and Cache
&lt;/h2&gt;

&lt;p&gt;The core reason for the redundant recompilation was the absence of a mechanism to track build inputs and reuse previously compiled artifacts.&lt;/p&gt;

&lt;p&gt;The agent’s compilation process depends on multiple inputs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;BPF source files&lt;/li&gt;
&lt;li&gt;Clang compiler configuration and environment&lt;/li&gt;
&lt;li&gt;Go build ID (which can affect generated headers)&lt;/li&gt;
&lt;li&gt;Generated headers and other build artifacts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before this change, none of these inputs were hashed or checked for differences. The compilation was always triggered unconditionally, causing expensive clang invocations even if the inputs were identical.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Solution: Input Hashing and Caching Compiled Objects
&lt;/h2&gt;

&lt;p&gt;The fix introduced a robust caching mechanism keyed by a hash that uniquely identifies the compilation inputs. Here’s how it works in detail:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hashing all relevant inputs:&lt;/strong&gt; The system computes a single hash that combines the contents of all BPF source files, the clang configuration and environment variables, the Go build ID, and any generated headers. This produces a unique fingerprint representing the exact compilation context.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cache lookup on agent restart:&lt;/strong&gt; When the agent starts, it calculates this hash and checks if compiled BPF objects for this hash already exist on disk.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Reuse or recompile:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If a matching cached object is found, the agent loads it directly, skipping the expensive compilation.&lt;/li&gt;
&lt;li&gt;If not, it proceeds with a normal compilation and then caches the resulting objects under the new hash.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This caching logic is primarily implemented in &lt;code&gt;pkg/datapath/loader/cache.go&lt;/code&gt;. To ensure correctness, new tests were added in &lt;code&gt;cache_test.go&lt;/code&gt; and &lt;code&gt;hash_test.go&lt;/code&gt; verifying that the hashing accurately reflects input changes and that cached objects are reused appropriately.&lt;/p&gt;

&lt;p&gt;This approach ensures that recompilation only happens when something truly changes, drastically reducing restart times.&lt;/p&gt;




&lt;h2&gt;
  
  
  Takeaway: Hashing Inputs to Cache Build Artifacts Saves Time and Resources
&lt;/h2&gt;

&lt;p&gt;Build systems and runtime components often depend on multiple inputs that rarely change between runs. Without tracking these inputs, systems waste time recompiling or rebuilding unnecessarily.&lt;/p&gt;

&lt;p&gt;By hashing all relevant inputs and caching build artifacts keyed by this hash, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Avoid redundant expensive work&lt;/li&gt;
&lt;li&gt;Speed up restarts and deployments&lt;/li&gt;
&lt;li&gt;Reduce CPU and memory usage during builds&lt;/li&gt;
&lt;li&gt;Improve developer and CI pipeline productivity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In Cilium’s case, this change turned restart times from minutes down to seconds, enabling faster iteration and more reliable CI.&lt;/p&gt;

&lt;p&gt;If you’re building systems that compile code or generate artifacts dynamically, consider implementing a similar input hashing and caching mechanism.&lt;/p&gt;




&lt;p&gt;This improvement came from the pull request titled "loader: Reuse compiled BPF objects across agent restarts" in the &lt;a href="https://github.com/cilium/cilium" rel="noopener noreferrer"&gt;cilium/cilium&lt;/a&gt; repository.&lt;/p&gt;

&lt;p&gt;Read the full breakdown on nossletter.tech.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://nossletter.tech/digest/cilium-49087-loader-reuse-compiled-bpf" rel="noopener noreferrer"&gt;Nossletter&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>bpf</category>
      <category>cilium</category>
      <category>performance</category>
      <category>buildsystems</category>
    </item>
    <item>
      <title>Enhancing ggml with Fused Sparse-Attention Masks and Precision Introspection in v0.28.0</title>
      <dc:creator>Priyadarshan Singh</dc:creator>
      <pubDate>Wed, 28 Oct 2026 21:26:05 +0000</pubDate>
      <link>https://dev.to/pdrojack/enhancing-ggml-with-fused-sparse-attention-masks-and-precision-introspection-in-v0280-3p40</link>
      <guid>https://dev.to/pdrojack/enhancing-ggml-with-fused-sparse-attention-masks-and-precision-introspection-in-v0280-3p40</guid>
      <description>&lt;h1&gt;
  
  
  Why Fused Sparse-Attention Masks Matter for ML Performance
&lt;/h1&gt;

&lt;p&gt;Sparse attention mechanisms have become a cornerstone of efficient transformer implementations, enabling models to scale by focusing computation on the most relevant parts of the input. However, supporting these sparse patterns efficiently in low-level ML compute libraries requires careful design of operations and data flow. The recent ggml v0.28.0 release tackles this challenge head-on by introducing a fused sparse-attention mask operation, alongside precision introspection APIs and cleaner mechanisms for skipping computation slots. These improvements not only simplify backend implementations but also unlock performance gains across CPU, CUDA, and Metal platforms.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Problem: Inefficient Sparse-Attention Support and Skipping Logic
&lt;/h1&gt;

&lt;p&gt;Prior to this release, ggml lacked a dedicated operation to fuse sparse-attention masks with top-k selection, forcing users to rely on separate steps or less efficient workarounds. This fragmented approach increased overhead and complexity in model implementations that rely heavily on sparse attention.&lt;/p&gt;

&lt;p&gt;Additionally, the way ggml handled skipping matrix slots was problematic. Instead of an explicit sentinel value, invalid or skipped matrix IDs were treated as out-of-range indices, which complicated backend logic. This meant that the compute engines had to interpret "magic" out-of-range values as signals to skip computations, leading to brittle and error-prone code.&lt;/p&gt;

&lt;p&gt;Moreover, introspecting the precision of compute nodes was limited, which made it harder for developers and optimizations to adapt based on the exact precision used during computation.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Solution: Introducing GGML_OP_TOP_K_MASK and Cleaner APIs
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Fused Sparse-Attention Mask Operation
&lt;/h2&gt;

&lt;p&gt;The centerpiece of this release is the new &lt;code&gt;GGML_OP_TOP_K_MASK&lt;/code&gt; operation. This operator fuses the top-k selection with the application of a sparse-attention mask into a single kernel. By doing so, it reduces intermediate memory usage and kernel launch overhead, leading to more efficient execution.&lt;/p&gt;

&lt;p&gt;Implementations of this op have been provided across all major backends:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CPU:&lt;/strong&gt; Optimized multi-threaded code paths leverage SIMD instructions where possible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CUDA:&lt;/strong&gt; GPU kernels utilize efficient parallel reductions and masking to minimize warp divergence.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Metal:&lt;/strong&gt; Metal shaders are crafted to exploit Apple GPUs' architecture for sparse attention.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This cross-platform consistency ensures that models using sparse attention can benefit regardless of hardware.&lt;/p&gt;

&lt;h2&gt;
  
  
  Explicit Skip Index with -1
&lt;/h2&gt;

&lt;p&gt;To simplify logic around skipping matrix slots, the release introduces support for &lt;code&gt;-1&lt;/code&gt; as a sentinel skip index in the &lt;code&gt;MUL_MAT_ID&lt;/code&gt; and &lt;code&gt;ADD_ID&lt;/code&gt; operations. This explicit value signals the backend to zero out the corresponding output row and skip computation cleanly.&lt;/p&gt;

&lt;p&gt;This change removes the ambiguity of out-of-range indices and allows backends to implement skipping more robustly and efficiently. For example, instead of checking for invalid indices and guessing their meaning, the backend can directly branch on &lt;code&gt;-1&lt;/code&gt; and avoid unnecessary work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Precision Introspection APIs
&lt;/h2&gt;

&lt;p&gt;Two new APIs, &lt;code&gt;ggml_prec_get_acc()&lt;/code&gt; and &lt;code&gt;ggml_prec_get_src()&lt;/code&gt;, have been added to query the precision of accumulation and source data on compute nodes. This enables more adaptive optimizations and debugging, as developers can programmatically determine if a node is using FP16, FP32, or other precisions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Improvements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Scale and sum operations have been relaxed to support non-contiguous inputs, increasing flexibility in tensor layouts.&lt;/li&gt;
&lt;li&gt;Various throughput improvements and bug fixes have been applied to all backends, further enhancing stability and performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Why This Matters: Takeaways for ML Library Design
&lt;/h1&gt;

&lt;p&gt;This update to ggml highlights several important engineering principles for ML compute libraries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fused operations for common patterns:&lt;/strong&gt; Sparse attention is ubiquitous in modern transformers. Providing fused ops tailored to these patterns reduces overhead and improves maintainability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Explicit sentinel values simplify backend logic:&lt;/strong&gt; Using a dedicated skip index makes the code clearer and less error-prone than relying on out-of-range or magic indices.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Precision introspection aids optimization:&lt;/strong&gt; APIs that expose compute node precision help downstream tooling and adaptive kernels tune performance dynamically.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cross-platform consistency:&lt;/strong&gt; Implementing new ops across CPU, CUDA, and Metal ensures broad hardware support and consistent behavior.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Together, these changes make ggml a more robust and performant foundation for ML workloads involving sparse attention and complex tensor operations.&lt;/p&gt;




&lt;p&gt;Credit for this deep-dive to the original PR in the ggml-org/ggml repository. Read the full breakdown on nossletter.tech.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://nossletter.tech/digest/ggml-1676-ggml-bump-version-to" rel="noopener noreferrer"&gt;Nossletter&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>performance</category>
      <category>gpu</category>
      <category>sparseattention</category>
    </item>
    <item>
      <title>Breaking Down Milvus QueryView Coordinator for Better Modularity and Maintainability</title>
      <dc:creator>Priyadarshan Singh</dc:creator>
      <pubDate>Tue, 27 Oct 2026 15:53:14 +0000</pubDate>
      <link>https://dev.to/pdrojack/breaking-down-milvus-queryview-coordinator-for-better-modularity-and-maintainability-3g31</link>
      <guid>https://dev.to/pdrojack/breaking-down-milvus-queryview-coordinator-for-better-modularity-and-maintainability-3g31</guid>
      <description>&lt;h1&gt;
  
  
  Why Modular Design Matters in Complex Systems
&lt;/h1&gt;

&lt;p&gt;In large-scale distributed systems like Milvus, coordination components often grow complex as they accumulate diverse responsibilities. The QueryView coordinator in Milvus, responsible for managing load, scheduling, schema lifecycle, and readiness, had become a tightly coupled monolith. This complexity made it challenging to maintain, extend, or even reason about individual parts independently — a common pain point in production systems where scalability and agility are critical.&lt;/p&gt;

&lt;p&gt;This article dives into how the Milvus team tackled this challenge by extracting distinct, immutable components within the QueryView coordinator. This change not only improved modularity but also paved the way for more robust scheduling and schema management with clear, stable interfaces.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Problem: A Monolithic Coordinator
&lt;/h1&gt;

&lt;p&gt;Originally, the QueryView coordinator bundled several responsibilities together:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Load snapshot handling:&lt;/strong&gt; Capturing the state of data load and replica distribution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Replica allocation and scheduling:&lt;/strong&gt; Deciding where and how data replicas should be placed and balanced.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scheduling cost calculations:&lt;/strong&gt; Using metrics to reconcile the placement of data efficiently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Schema lifecycle management:&lt;/strong&gt; Tracking schema versions and ensuring consistent reads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Readiness protocols:&lt;/strong&gt; Managing component readiness and synchronization progress.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All these concerns lived in one coordinator module, leading to complex interdependencies. For example, load snapshots were mutable and intertwined with scheduling logic, making it hard to isolate bugs or introduce new scheduling strategies without risking side effects. Similarly, schema management was tightly coupled with readiness checks, complicating schema evolution.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Fix: Extracting Immutable Components and Interfaces
&lt;/h1&gt;

&lt;p&gt;The core idea behind the fix was to split the monolithic coordinator into well-defined, immutable components with clear interfaces. This separation enables each part to evolve independently and be tested in isolation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Immutable Load Snapshots and Placement Management
&lt;/h2&gt;

&lt;p&gt;Instead of mutable shared state, load information is now captured as immutable snapshots. These snapshots represent a consistent view of the cluster load and replica placements at a given point in time. By treating them as immutable, the system avoids side effects and race conditions during scheduling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scheduling with Cost-Based Reconciliation Using LogicalSize Weights
&lt;/h2&gt;

&lt;p&gt;Scheduling was enhanced by introducing cost calculations based on immutable &lt;code&gt;LogicalSize&lt;/code&gt; weights. This abstraction allows the scheduler to evaluate placement decisions quantitatively, facilitating more efficient and balanced replica allocation. The cost-based reconciliation process compares current and desired placements, driving incremental adjustments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Schema Lifecycle Management with Certified Read Schemas
&lt;/h2&gt;

&lt;p&gt;Schema handling was extracted into its own component that manages certified read schemas and snapshot bindings. This ensures that schema versions are tracked consistently and that reads always operate against a known-good schema snapshot. It decouples schema evolution from load and scheduling concerns, improving reliability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Readiness Protocols with Scoped Loading and Progress Fences
&lt;/h2&gt;

&lt;p&gt;Readiness checks now use scoped loading and progress fences to track component states precisely. This mechanism helps coordinate startup and recovery sequences without conflating readiness with other logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  New Interfaces to Decouple Dependencies
&lt;/h2&gt;

&lt;p&gt;To glue these components together while maintaining loose coupling, the PR introduces interfaces like &lt;code&gt;LoadInfoCatalog&lt;/code&gt; and &lt;code&gt;PrepareDataViewSchema&lt;/code&gt;. These interfaces abstract data access and preparation logic, allowing components to interact via contracts rather than concrete implementations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Maintaining Legacy Support While Removing Unreleased Formats
&lt;/h2&gt;

&lt;p&gt;The change preserves legacy recovery paths to ensure backward compatibility with existing deployments. At the same time, it removes support for unreleased or experimental formats, reducing maintenance overhead and potential confusion.&lt;/p&gt;

&lt;h1&gt;
  
  
  Lessons Learned: The Power of Clear Boundaries
&lt;/h1&gt;

&lt;p&gt;This refactoring highlights the importance of splitting complex coordination logic into immutable, well-defined components. Clear interfaces enable teams to reason about each part independently, facilitate testing, and reduce the risk of unintended side effects.&lt;/p&gt;

&lt;p&gt;For engineers working on distributed systems or large coordination modules, this approach encourages incremental integration of new features without disrupting existing workflows. It also paves the way for future optimizations, such as more advanced scheduling algorithms or schema versioning strategies.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;The Milvus team's extraction of QueryView coordinator components exemplifies how thoughtful modularization can tame complexity in distributed systems. By embracing immutability, cost-based scheduling, and interface-driven design, they improved maintainability and extensibility — a valuable blueprint for similar challenges elsewhere.&lt;/p&gt;




&lt;p&gt;Credit to the original PR in the milvus-io/milvus repository. Read the full breakdown on nossletter.tech.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://nossletter.tech/digest/milvus-54547-feat-extract-queryview-coordinator" rel="noopener noreferrer"&gt;Nossletter&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>milvus</category>
      <category>distributedsystems</category>
      <category>scheduling</category>
      <category>modularity</category>
    </item>
    <item>
      <title>Optimizing JSON Column Storage in ClickHouse with SHARED Typed Paths</title>
      <dc:creator>Priyadarshan Singh</dc:creator>
      <pubDate>Mon, 26 Oct 2026 14:51:04 +0000</pubDate>
      <link>https://dev.to/pdrojack/optimizing-json-column-storage-in-clickhouse-with-shared-typed-paths-306c</link>
      <guid>https://dev.to/pdrojack/optimizing-json-column-storage-in-clickhouse-with-shared-typed-paths-306c</guid>
      <description>&lt;h1&gt;
  
  
  Why JSON Storage Efficiency Matters in ClickHouse
&lt;/h1&gt;

&lt;p&gt;ClickHouse is a high-performance analytical database designed for fast queries on large datasets. JSON columns, which can be deeply nested and have many paths, are increasingly common as applications ingest semi-structured data. However, storing each JSON typed path as separate files quickly becomes a bottleneck, especially on object storage systems where thousands of small files cause high request overhead and degrade performance.&lt;/p&gt;

&lt;p&gt;This article explores a recent improvement in ClickHouse's JSON column storage model that introduces a &lt;code&gt;SHARED&lt;/code&gt; modifier for typed paths. This change significantly reduces the number of files and object storage requests while preserving efficient read access.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Problem: File Explosion with JSON Typed Paths
&lt;/h1&gt;

&lt;p&gt;Prior to this change, each typed path in a JSON column was stored as its own set of files within MergeTree parts. For example, a JSON column with hundreds of typed paths would generate thousands of files per data part. This file explosion leads to several issues:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;High object storage request overhead:&lt;/strong&gt; Object stores like S3 charge per request, so thousands of small files cause increased costs and latency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance degradation:&lt;/strong&gt; Managing and opening many small files slows down query execution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Operational complexity:&lt;/strong&gt; Large numbers of files complicate maintenance and increase metadata management overhead.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The root cause is that the storage model treats each typed path as an independent data stream, resulting in many small files instead of consolidated storage.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Solution: Introducing SHARED Typed Paths
&lt;/h1&gt;

&lt;p&gt;To address this, the PR adds a &lt;code&gt;SHARED&lt;/code&gt; modifier for JSON typed paths. Instead of creating separate files for each path, all &lt;code&gt;SHARED&lt;/code&gt; paths within a data part are grouped into a constant set of shared files.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Shared files per part:&lt;/strong&gt; All &lt;code&gt;SHARED&lt;/code&gt; typed paths write their data into the same set of files rather than separate files per path.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Marks file for indexing:&lt;/strong&gt; A marks file stores offsets within granules that index the data for each path. This allows the system to locate the data for a particular path efficiently.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Efficient partial reads:&lt;/strong&gt; Because the marks file provides offsets, queries can read only the relevant portions of the shared files, preserving fine-grained access.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Compatibility:&lt;/strong&gt; The approach maintains compatibility with existing features such as &lt;code&gt;ALTER&lt;/code&gt; operations, ensuring seamless integration.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Technical Details
&lt;/h2&gt;

&lt;p&gt;The marks file acts as a directory mapping each path's data offsets within the shared files. When a query requests data for a specific path, ClickHouse uses the marks to seek to the correct position in the shared files and reads only the necessary bytes. This avoids loading all paths' data and keeps query performance high.&lt;/p&gt;

&lt;p&gt;This design cleverly balances the trade-off between file count reduction and read efficiency. By consolidating many small data streams into shared files indexed by offsets, it reduces overhead without sacrificing the ability to perform selective reads.&lt;/p&gt;

&lt;h1&gt;
  
  
  Takeaway: Consolidate Small Data Streams to Improve Storage Efficiency
&lt;/h1&gt;

&lt;p&gt;This improvement highlights an important engineering principle when dealing with many small data substreams: consolidating storage into shared files indexed by offsets can drastically reduce file system or object storage overhead.&lt;/p&gt;

&lt;p&gt;Especially in cloud environments where object storage request costs and latencies matter, reducing file counts minimizes operational costs and improves performance. At the same time, maintaining an index of offsets preserves the ability to read data selectively and efficiently.&lt;/p&gt;

&lt;p&gt;This balance is crucial for production-grade systems handling complex data types like JSON, which can easily generate many small data streams.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;The addition of &lt;code&gt;SHARED&lt;/code&gt; typed paths in ClickHouse's JSON type storage model is a practical and elegant solution to the problem of excessive file counts for wide JSON columns. By grouping paths into shared files and indexing offsets with a marks file, ClickHouse reduces object storage overhead and improves query performance without losing fine-grained read capabilities.&lt;/p&gt;

&lt;p&gt;This change exemplifies how thoughtful storage design can address real-world scalability challenges in analytical databases.&lt;/p&gt;




&lt;p&gt;Credit: This article is based on the merged PR "Add &lt;code&gt;SHARED&lt;/code&gt; typed paths to the JSON type" in the ClickHouse repository.&lt;/p&gt;

&lt;p&gt;Read the full breakdown on nossletter.tech.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://nossletter.tech/digest/clickhouse-127000-add-shared-typed-paths" rel="noopener noreferrer"&gt;Nossletter&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>clickhouse</category>
      <category>json</category>
      <category>storage</category>
      <category>performance</category>
    </item>
    <item>
      <title>How Python's ssl Module Gained Support for Encrypted Client Hello (ECH) to Enhance TLS Privacy</title>
      <dc:creator>Priyadarshan Singh</dc:creator>
      <pubDate>Sun, 25 Oct 2026 08:40:22 +0000</pubDate>
      <link>https://dev.to/pdrojack/how-pythons-ssl-module-gained-support-for-encrypted-client-hello-ech-to-enhance-tls-privacy-9bj</link>
      <guid>https://dev.to/pdrojack/how-pythons-ssl-module-gained-support-for-encrypted-client-hello-ech-to-enhance-tls-privacy-9bj</guid>
      <description>&lt;h2&gt;
  
  
  Why Encrypted Client Hello Matters for TLS Privacy
&lt;/h2&gt;

&lt;p&gt;Transport Layer Security (TLS) is the backbone of secure communication on the internet. However, until recently, a critical piece of the TLS handshake—the ClientHello message—was sent in plaintext, exposing metadata like the server name and client preferences to network observers. Encrypted Client Hello (ECH) is an emerging TLS extension designed to encrypt this initial handshake message, significantly improving user privacy and preventing passive surveillance or censorship.&lt;/p&gt;

&lt;p&gt;Python's standard library &lt;code&gt;ssl&lt;/code&gt; module is widely used for secure communications in countless applications. Yet, before this change, it lacked support for ECH, limiting developers who wanted to leverage this privacy enhancement in their Python programs.&lt;/p&gt;

&lt;p&gt;This article dives into the technical challenges and implementation details behind adding ECH support to Python's &lt;code&gt;ssl&lt;/code&gt; module, illustrating how evolving cryptographic protocols require careful integration across language boundaries.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem: Missing ECH Support in Python's ssl Module
&lt;/h2&gt;

&lt;p&gt;The TLS ClientHello message initiates the handshake by communicating client capabilities and the desired server name. Traditionally, this message is unencrypted, allowing observers to see which sites a client is connecting to, even if the rest of the session is encrypted.&lt;/p&gt;

&lt;p&gt;Encrypted Client Hello (ECH) aims to fix this by encrypting the entire ClientHello message, hiding sensitive metadata from on-path adversaries. This is especially important in environments where network censorship or traffic analysis is a concern.&lt;/p&gt;

&lt;p&gt;Despite ECH's growing adoption and draft standardization, Python's &lt;code&gt;ssl&lt;/code&gt; module and its underlying C extension &lt;code&gt;_ssl&lt;/code&gt; did not support ECH. This meant Python applications could not benefit from this privacy feature, putting them at a disadvantage compared to other TLS implementations that had begun adopting ECH.&lt;/p&gt;

&lt;p&gt;The root cause was that the &lt;code&gt;_ssl&lt;/code&gt; C extension lacked the necessary hooks and logic to construct, send, and process the ECH extension data during the TLS handshake. Additionally, the Python-level &lt;code&gt;ssl.py&lt;/code&gt; interface did not expose any means to configure or enable ECH.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Fix: Extending _ssl and Python APIs to Handle ECH
&lt;/h2&gt;

&lt;p&gt;Adding ECH support required coordinated changes at multiple layers:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Enhancing the _ssl C Extension
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;_ssl&lt;/code&gt; module, implemented in C, interfaces directly with OpenSSL to perform TLS operations. To support ECH, it needed to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Accept ECH configuration data (e.g., public keys and parameters) from Python code.&lt;/li&gt;
&lt;li&gt;Integrate with OpenSSL's APIs for constructing and encrypting the ClientHello message with ECH extensions.&lt;/li&gt;
&lt;li&gt;Handle server-side decryption of the ECH payload when acting as a TLS server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This involved adding new data structures and logic to parse and include ECH extension bytes in the handshake messages.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Updating the Python ssl.py Interface
&lt;/h3&gt;

&lt;p&gt;On the Python side, the &lt;code&gt;ssl&lt;/code&gt; module was extended to expose new APIs allowing developers to specify ECH configurations. This includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Methods to load or specify ECH keys and configurations.&lt;/li&gt;
&lt;li&gt;Options to enable or disable ECH for client connections.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By exposing these options in pure Python, developers can now opt into ECH without dealing with low-level C code.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Adding Tests and Documentation
&lt;/h3&gt;

&lt;p&gt;Supporting a complex and evolving standard like ECH requires robust testing. The PR introduced comprehensive tests that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verify correct construction and encryption of ClientHello messages.&lt;/li&gt;
&lt;li&gt;Ensure server-side decryption works as expected.&lt;/li&gt;
&lt;li&gt;Test interoperability with different ECH configurations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Additionally, documentation was updated to guide users on how to use the new ECH features.&lt;/p&gt;

&lt;h3&gt;
  
  
  Handling the Evolving Draft Specification
&lt;/h3&gt;

&lt;p&gt;ECH is still evolving, and the implementation tracks the latest draft standards. This means the code is designed to be adaptable, with clear pathways to update cryptographic parameters and message formats as the standard matures.&lt;/p&gt;




&lt;h2&gt;
  
  
  Lessons Learned: Integrating Emerging TLS Features is a Cross-Layer Effort
&lt;/h2&gt;

&lt;p&gt;Adding support for new TLS extensions like ECH is far from trivial. It requires:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deep integration in the underlying TLS library bindings (_ssl in Python).&lt;/li&gt;
&lt;li&gt;Thoughtful API design to expose new features in a user-friendly way.&lt;/li&gt;
&lt;li&gt;Rigorous testing to ensure security and correctness.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This change exemplifies how evolving cryptographic standards necessitate collaboration between C-level system code and high-level language interfaces.&lt;/p&gt;

&lt;p&gt;For Python developers, this means more privacy-preserving TLS connections out of the box. For the broader community, it highlights the importance of keeping standard libraries up to date with security innovations.&lt;/p&gt;




&lt;p&gt;This work was originally contributed in the PR titled "gh-89730: Implement support for Encrypted Client Hello (ECH) in &lt;code&gt;ssl&lt;/code&gt;" in the python/cpython repository.&lt;/p&gt;

&lt;p&gt;Read the full breakdown on nossletter.tech.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://nossletter.tech/digest/cpython-160318-gh-89730-implement-support" rel="noopener noreferrer"&gt;Nossletter&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>tls</category>
      <category>security</category>
      <category>cryptography</category>
    </item>
    <item>
      <title>Enhancing Distributed Streaming in Milvus: Remote TransformLog Subscriptions and MVCC Barriers</title>
      <dc:creator>Priyadarshan Singh</dc:creator>
      <pubDate>Fri, 23 Oct 2026 17:23:24 +0000</pubDate>
      <link>https://dev.to/pdrojack/enhancing-distributed-streaming-in-milvus-remote-transformlog-subscriptions-and-mvcc-barriers-3dnj</link>
      <guid>https://dev.to/pdrojack/enhancing-distributed-streaming-in-milvus-remote-transformlog-subscriptions-and-mvcc-barriers-3dnj</guid>
      <description>&lt;h1&gt;
  
  
  Enhancing Distributed Streaming in Milvus: Remote TransformLog Subscriptions and MVCC Barriers
&lt;/h1&gt;

&lt;p&gt;Distributed systems that rely on streaming replication face a delicate balance between efficiency, consistency, and fault tolerance. Milvus, a popular vector database, recently tackled a subtle but critical issue in its streaming replication mechanism. By introducing remote TransformLog subscriptions with ordered, resumable delivery and multi-version concurrency control (MVCC) barriers, Milvus now supports more reliable recovery and consistent query progress tracking.&lt;/p&gt;

&lt;p&gt;In this article, we'll explore the problem Milvus faced, the technical mechanisms introduced in the fix, and the broader lessons for anyone implementing distributed streaming with strong consistency guarantees.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem: Inefficient Recovery and Inconsistent Streaming Progress
&lt;/h2&gt;

&lt;p&gt;Before this change, Milvus’s streaming replication lacked support for remote TransformLog subscriptions that could deliver entries in order and resume from interruptions. This gap led to two main issues:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Inefficient recovery:&lt;/strong&gt; Without resumable cursors and ordered delivery, replaying logs during recovery was unreliable and potentially redundant.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Inconsistent query progress tracking:&lt;/strong&gt; The system did not preserve MVCC barriers properly, which are essential for snapshot isolation during queries. This caused checkpoints to advance prematurely and queries to see inconsistent or stale data.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Additionally, the backpressure mechanism was simplistic — it relied on a scanner mode rather than actual cache occupancy, which failed to regulate load effectively and maintain stable delivery rates.&lt;/p&gt;

&lt;p&gt;These issues combined to create a streaming replication system that was fragile under failure conditions and complicated to maintain strong consistency guarantees.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Fix: Remote Subscriptions, MVCC Barriers, and Cache-Aware Backpressure
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Remote TransformLog Subscriptions with Resumable Cursors
&lt;/h3&gt;

&lt;p&gt;The core innovation was introducing a new &lt;code&gt;SubscribeTransform&lt;/code&gt; RPC mechanism that supports both local and remote owner routing. This subscription model includes a handshake protocol to establish and close subscriptions gracefully. Key features include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ordered Entry and SyncUp delivery:&lt;/strong&gt; Ensuring that TransformLog entries arrive in the correct sequence, which is crucial for consistent replay and state updates.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Resumable cursors:&lt;/strong&gt; If a connection drops or is interrupted, the subscription can resume from the last known position, avoiding redundant processing and speeding up recovery.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Backoff and reconnect strategies:&lt;/strong&gt; Failed subscription attempts back off exponentially, and reconnects are suspended when there are no active subscriptions, conserving resources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Idle stream reclamation:&lt;/strong&gt; Streams that are no longer in use are cleaned up promptly, preventing resource leaks.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Aligning Recovery with WAL Consumer
&lt;/h3&gt;

&lt;p&gt;Recovery logic was aligned with the Write-Ahead Log (WAL) Consumer by filtering replay events before they reach data-only handlers. This ensures that replayed events are consistent and that recovery proceeds in a controlled manner.&lt;/p&gt;

&lt;h3&gt;
  
  
  MVCC Barrier Coordination
&lt;/h3&gt;

&lt;p&gt;MVCC barriers are preserved and scoped progress is published in WAL order without advancing durable checkpoints prematurely. This means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Volatile barriers are queued until RecoveryStorage confirms prefix completeness:&lt;/strong&gt; This prevents queries from seeing inconsistent snapshots.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Durable checkpoints advance only after safe conditions:&lt;/strong&gt; Avoiding premature checkpoint advancement maintains snapshot isolation and query correctness.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cache-Aware Backpressure
&lt;/h3&gt;

&lt;p&gt;The previous backpressure mechanism based on scanner mode was replaced with a more sophisticated cache-occupancy-based admission control:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;WAB cache uses capacity and TTL eviction:&lt;/strong&gt; This ensures that the cache does not overflow and that stale entries are evicted timely.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;RecoveryStorage consumption constraints:&lt;/strong&gt; These constraints help regulate admission based on actual resource usage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Configurable slowdown and rejection thresholds:&lt;/strong&gt; When the cache occupancy crosses certain thresholds, the system slows down or rejects new entries to maintain stability.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Additional Improvements
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;WALSummary reads reuse verified chunk footers:&lt;/strong&gt; This optimization prevents repopulation of retired entries, improving efficiency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Support for independent reader cancellation and GC snapshot protection:&lt;/strong&gt; This enhances the robustness of concurrent reads and garbage collection.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Takeaway: Combining Resumable Cursors, MVCC Barriers, and Backpressure for Strong Consistency
&lt;/h2&gt;

&lt;p&gt;Implementing distributed streaming subscriptions with strong consistency is challenging. Milvus’s approach highlights several key principles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Resumable cursors and handshake protocols are essential&lt;/strong&gt; for robust, ordered, and fault-tolerant delivery.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;MVCC barriers must be carefully coordinated&lt;/strong&gt; to preserve snapshot isolation and prevent premature checkpoint advancement.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Backpressure should be cache-aware and resource-sensitive,&lt;/strong&gt; not simplistic or mode-based, to maintain stability under load.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Together, these mechanisms enable efficient recovery, consistent query progress tracking, and reliable streaming replication.&lt;/p&gt;

&lt;p&gt;For engineers building distributed streaming systems, this case study underscores the importance of integrating consistency controls with resource management and connection resilience.&lt;/p&gt;




&lt;p&gt;This article is based on the merged PR in the &lt;a href="https://github.com/milvus-io/milvus" rel="noopener noreferrer"&gt;milvus-io/milvus&lt;/a&gt; repository titled "feat: add remote TransformLog subscriptions and MVCC barriers." Read the full breakdown on nossletter.tech.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://nossletter.tech/digest/milvus-54344-feat-add-remote-transformlog" rel="noopener noreferrer"&gt;Nossletter&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>distributedsystems</category>
      <category>streaming</category>
      <category>consistency</category>
      <category>replication</category>
    </item>
    <item>
      <title>How Milvus Improved Distributed Resource Loading with Streaming and Centralized Management</title>
      <dc:creator>Priyadarshan Singh</dc:creator>
      <pubDate>Thu, 22 Oct 2026 13:34:36 +0000</pubDate>
      <link>https://dev.to/pdrojack/how-milvus-improved-distributed-resource-loading-with-streaming-and-centralized-management-4b60</link>
      <guid>https://dev.to/pdrojack/how-milvus-improved-distributed-resource-loading-with-streaming-and-centralized-management-4b60</guid>
      <description>&lt;h2&gt;
  
  
  Why Resource Loading Matters in Distributed Query Systems
&lt;/h2&gt;

&lt;p&gt;In distributed systems like Milvus, efficient and reliable resource management is critical. Analyzer files—key resources used during query processing—must be fetched, validated, and kept consistent across multiple components. Failures or stale data in this process can cause query errors, inconsistent results, or even system instability. This article explores a recent Milvus improvement that overhauled how analyzer file resources are prepared, moving from legacy RPCs and local caches prone to transient failures, to a robust streaming client with centralized metadata management.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem with Legacy Resource Loading
&lt;/h2&gt;

&lt;p&gt;Previously, Milvus fetched analyzer file resources using older RPC mechanisms and local caching strategies. These legacy approaches suffered from several issues:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No batch fetching:&lt;/strong&gt; Resources were requested individually, increasing overhead and latency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lack of centralized metadata:&lt;/strong&gt; Without a single source of truth, metadata could become inconsistent or stale.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Poor concurrency coordination:&lt;/strong&gt; Multiple components might redundantly download the same resource without coordination.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inadequate retry and expiration handling:&lt;/strong&gt; Transient IO errors often caused failures, and caches lacked time-to-live (TTL) policies, leading to stale data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These limitations led to validation failures in the query coordinator and runners, inconsistent resource states, and unreliable query execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  The New Streaming Client and AnalyzerResourceManager
&lt;/h2&gt;

&lt;p&gt;The core of the fix is introducing a streaming client that supports a new batch FetchFileResources RPC. This API can fetch multiple resource metadata and content items by their IDs or names in a single request, dramatically improving efficiency.&lt;/p&gt;

&lt;h3&gt;
  
  
  Centralized Metadata Management
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;AnalyzerResourceManager&lt;/code&gt; acts as the central authority for managing resource metadata. It:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetches metadata in batches via the streaming client.&lt;/li&gt;
&lt;li&gt;Coordinates concurrent download requests to avoid duplicate work.&lt;/li&gt;
&lt;li&gt;Implements shared cancellation so that if one component cancels, others depending on the same resource are notified.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Robust Download and Caching
&lt;/h3&gt;

&lt;p&gt;Downloads are retried locally on transient failures, reducing the chance of query errors due to momentary network glitches. Files are cached with TTL-based expiration, ensuring that stale data is refreshed proactively.&lt;/p&gt;

&lt;h3&gt;
  
  
  Validation Integration
&lt;/h3&gt;

&lt;p&gt;Validation logic is routed through the streaming client, which verifies resource integrity against the fetched metadata. This ensures that corrupted or incomplete resources are detected early, with precise status errors returned to the caller.&lt;/p&gt;

&lt;h3&gt;
  
  
  Runner Lifecycle Improvements
&lt;/h3&gt;

&lt;p&gt;Runners—components that execute queries—now pin exact resource bindings and include schema IDs in their identity. This guarantees that the runner's resource environment is stable and consistent throughout its lifecycle.&lt;/p&gt;

&lt;p&gt;Additionally, if a runner is unavailable, it can be prepared on demand using retry logic after releasing its admission scope. This ensures that resources are always available during write-ahead log (WAL) replay and query execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;p&gt;This change highlights several important principles for distributed resource management:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Batching and streaming reduce overhead:&lt;/strong&gt; Fetching multiple resources in a single streaming RPC is more efficient than many individual requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Centralized metadata prevents inconsistency:&lt;/strong&gt; A single source of truth for resource metadata avoids stale or conflicting information.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Coordinated concurrency avoids redundant work:&lt;/strong&gt; Managing concurrent downloads and cancellations reduces wasted network and computation resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explicit lifecycle management improves stability:&lt;/strong&gt; Pinning resources to runner lifecycles and including schema IDs ensures consistent execution environments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Robust retry and caching policies reduce transient failures:&lt;/strong&gt; Handling IO errors locally and using TTL caches minimizes query disruptions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Together, these improvements make Milvus's distributed query execution more reliable and performant.&lt;/p&gt;




&lt;p&gt;This article is based on the PR "fix: prepare analyzer file resources through streaming client" merged into the milvus-io/milvus repository. Read the full breakdown on nossletter.tech.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://nossletter.tech/digest/milvus-54302-fix-prepare-analyzer-file" rel="noopener noreferrer"&gt;Nossletter&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>distributedsystems</category>
      <category>rpc</category>
      <category>resourcemanagement</category>
      <category>milvus</category>
    </item>
    <item>
      <title>Building a Core Storage Library for Primary Key Indexing in Milvus</title>
      <dc:creator>Priyadarshan Singh</dc:creator>
      <pubDate>Wed, 21 Oct 2026 13:54:07 +0000</pubDate>
      <link>https://dev.to/pdrojack/building-a-core-storage-library-for-primary-key-indexing-in-milvus-5gp7</link>
      <guid>https://dev.to/pdrojack/building-a-core-storage-library-for-primary-key-indexing-in-milvus-5gp7</guid>
      <description>&lt;h1&gt;
  
  
  Why a Core Storage Library Matters for Primary Key Indexing
&lt;/h1&gt;

&lt;p&gt;When working with large-scale vector databases like Milvus, efficient and consistent primary key indexing is crucial. Primary keys serve as the backbone for data retrieval, and mishandling their storage can lead to fragmented logic, duplicated code, and performance bottlenecks. Before this enhancement, Milvus lacked a unified core storage library for primary key indexes, resulting in scattered implementations and maintenance challenges.&lt;/p&gt;

&lt;p&gt;This article dives into how introducing a dedicated core storage library for primary key indexes addresses these issues, streamlines storage lifecycle management, and sets the stage for incremental improvements without disrupting existing workflows.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Problem: Fragmented Storage Logic for Primary Keys
&lt;/h1&gt;

&lt;p&gt;In Milvus’s architecture, primary key indexes are essential for locating vector data efficiently. However, prior to this enhancement, there was no shared, core storage library dedicated to managing these indexes. Instead, primary key handling was embedded in various nodes or test-only memory engines.&lt;/p&gt;

&lt;p&gt;This fragmentation led to several issues:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Duplicated Storage Logic:&lt;/strong&gt; Different components implemented their own versions of primary key storage and retrieval, increasing maintenance overhead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inconsistent Behavior:&lt;/strong&gt; Without a unified approach, lifecycle management of storage layers, such as LSM-tree generations, was handled inconsistently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Limited Efficiency:&lt;/strong&gt; Embedding logic in nodes or memory engines limited the ability to optimize write paths and manage storage transitions smoothly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The root cause was clear: the absence of a dedicated, shared library meant no single source of truth or standardized mechanism for primary key storage.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Solution: Introducing &lt;code&gt;internal/pkindex&lt;/code&gt; Core Library
&lt;/h1&gt;

&lt;p&gt;To tackle these challenges, the PR introduces a new core storage library named &lt;code&gt;internal/pkindex&lt;/code&gt;. This library encapsulates all primary key index storage logic, providing a consistent, efficient, and reusable foundation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Components of the Library
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Order-Preserving Encoding of Primary Keys&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The library implements an encoding scheme that preserves the order of primary keys. This is critical for range queries and efficient lookups, ensuring that the storage engine can maintain sorted keys without additional overhead.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;SSTable Read/Write via Pebble&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The library leverages Pebble (version 1.1.5), a performant key-value store inspired by LevelDB, to manage SSTables (Sorted String Tables). By integrating Pebble, the library handles persistent storage on local files, enabling robust and efficient disk-backed storage.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Engine Managing Write Paths and Lifecycle Transitions&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One of the standout features is an engine within the library that manages the write path and lifecycle transitions of LSM (Log-Structured Merge) tree generations. Crucially, it does so without introducing write pauses, enabling smooth compaction and generation transitions.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Error Categorization and Backward Compatibility&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The library categorizes errors to facilitate better error handling and debugging. It also maintains backward-compatible error message formatting, ensuring existing components that rely on previous formats continue to function without disruption.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works in Practice
&lt;/h2&gt;

&lt;p&gt;Imagine a policy that needs to write primary key data as part of indexing. Instead of each node or engine implementing its own storage logic, it now calls into &lt;code&gt;internal/pkindex&lt;/code&gt;. The library encodes the keys preserving their order, writes them to SSTables using Pebble, and manages the underlying lifecycle transitions automatically. This separation allows for incremental adoption; components can start using the library without needing to overhaul their entire storage logic.&lt;/p&gt;




&lt;h1&gt;
  
  
  Lessons Learned: The Power of Separation and Incremental Adoption
&lt;/h1&gt;

&lt;p&gt;This enhancement underscores the importance of isolating core storage logic into a dedicated library. By doing so, Milvus achieves:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Consistency:&lt;/strong&gt; Uniform handling of primary key storage and lifecycle management across components.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintainability:&lt;/strong&gt; Reduced code duplication and clearer separation of concerns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance:&lt;/strong&gt; Efficient write paths and seamless lifecycle transitions without write pauses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility:&lt;/strong&gt; The ability to incrementally adopt the new library across the system without breaking existing behavior.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In complex distributed systems, especially those dealing with storage and indexing, having a well-defined core library not only simplifies development but also lays a strong foundation for future improvements.&lt;/p&gt;




&lt;p&gt;This article is based on the recent pull request merged into the Milvus repository. Read the full breakdown on nossletter.tech.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://nossletter.tech/digest/milvus-53910-enhance-add-the-primary" rel="noopener noreferrer"&gt;Nossletter&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>milvus</category>
      <category>storage</category>
      <category>pebble</category>
      <category>indexing</category>
    </item>
    <item>
      <title>Enhancing Node.js Module Privacy: Introducing --experimental-strip-private-modules</title>
      <dc:creator>Priyadarshan Singh</dc:creator>
      <pubDate>Wed, 21 Oct 2026 10:46:58 +0000</pubDate>
      <link>https://dev.to/pdrojack/enhancing-nodejs-module-privacy-introducing-experimental-strip-private-modules-3i66</link>
      <guid>https://dev.to/pdrojack/enhancing-nodejs-module-privacy-introducing-experimental-strip-private-modules-3i66</guid>
      <description>&lt;h1&gt;
  
  
  Why Module Privacy Matters in Node.js
&lt;/h1&gt;

&lt;p&gt;In the Node.js ecosystem, managing dependencies often means dealing with nested &lt;code&gt;node_modules&lt;/code&gt; directories, where public and private packages coexist. Ensuring that private packages are handled correctly is crucial, especially when it comes to stripping types or other metadata during builds. Without careful controls, private package information can leak or public packages can be inadvertently altered, leading to subtle bugs or security concerns.&lt;/p&gt;

&lt;p&gt;This article explores a recent improvement in Node.js that introduces a new CLI flag to better manage private packages during type stripping, preventing unintended side effects and privacy leaks.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Problem: Overbroad Type Stripping and Privacy Smuggling
&lt;/h1&gt;

&lt;p&gt;Previously, Node.js applied type stripping broadly to all packages inside &lt;code&gt;node_modules&lt;/code&gt;. This approach had two main issues:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Unintended Removal of Types from Public Packages:&lt;/strong&gt; Since type stripping wasn’t selective, it could remove type information even from public packages that should retain their typings.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Privacy Smuggling via Nested &lt;code&gt;package.json&lt;/code&gt; Files:&lt;/strong&gt; Private package metadata could be hidden or "smuggled" inside nested &lt;code&gt;node_modules&lt;/code&gt; directories of non-private packages, bypassing intended privacy boundaries.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The root cause was the lack of granularity in the stripping logic. The system did not distinguish between private and public packages effectively, nor did it enforce strict checks on package privacy metadata in nested directories. Internal modules like &lt;code&gt;package_json_reader.js&lt;/code&gt; and &lt;code&gt;node_modules.cc&lt;/code&gt; needed more precise logic to identify private packages correctly.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Fix: Introducing --experimental-strip-private-modules
&lt;/h1&gt;

&lt;p&gt;To address these issues, the Node.js team introduced a new CLI flag: &lt;code&gt;--experimental-strip-private-modules&lt;/code&gt;. This flag changes the behavior of type stripping in several key ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Selective Type Stripping:&lt;/strong&gt; When enabled, type stripping applies &lt;em&gt;only&lt;/em&gt; to packages explicitly marked as private in their &lt;code&gt;package.json&lt;/code&gt; files. This prevents public packages from losing their type information inadvertently.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enhanced Privacy Detection:&lt;/strong&gt; Updates to &lt;code&gt;package_json_reader.js&lt;/code&gt; and &lt;code&gt;node_modules.cc&lt;/code&gt; improve the detection of private packages. The logic now carefully parses the &lt;code&gt;package.json&lt;/code&gt; metadata, ensuring that private flags are respected even in deeply nested &lt;code&gt;node_modules&lt;/code&gt; folders.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Improved TypeScript Handling:&lt;/strong&gt; The internal module &lt;code&gt;internal/modules/typescript.js&lt;/code&gt; was updated to align with the new privacy-aware stripping logic, maintaining consistency in how TypeScript types are processed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Comprehensive Testing:&lt;/strong&gt; New tests in &lt;code&gt;test/es-module/test-typescript.mjs&lt;/code&gt; validate that type stripping behaves as expected under the new flag, covering scenarios involving nested packages and privacy boundaries.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How It Works Internally
&lt;/h2&gt;

&lt;p&gt;The enhanced privacy check involves reading the &lt;code&gt;package.json&lt;/code&gt; for each package encountered during module resolution. If the &lt;code&gt;private&lt;/code&gt; field is set to &lt;code&gt;true&lt;/code&gt;, and the CLI flag is enabled, the type stripping logic activates for that package.&lt;/p&gt;

&lt;p&gt;For example, a policy like this might check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;packageJson&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kr"&gt;private&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;cliFlags&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;experimentalStripPrivateModules&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;stripTypes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;packagePath&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;preserveTypes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;packagePath&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This targeted approach ensures that only intended packages are affected.&lt;/p&gt;

&lt;p&gt;Additionally, by tightening the logic in &lt;code&gt;package_json_reader.js&lt;/code&gt;, the system prevents scenarios where a private package's &lt;code&gt;package.json&lt;/code&gt; could be nested inside a public package without proper recognition, closing a loophole that previously allowed privacy smuggling.&lt;/p&gt;

&lt;h1&gt;
  
  
  Takeaway: Enforce Explicit Boundaries and Use Targeted Flags
&lt;/h1&gt;

&lt;p&gt;This change highlights an important lesson in package management and build tooling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Avoid Broad Application of Transformations:&lt;/strong&gt; Applying transformations globally without considering package metadata can lead to unintended consequences.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Explicitly Enforce Privacy Boundaries:&lt;/strong&gt; Tools should respect package privacy metadata, especially in complex nested dependency trees.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use Feature Flags for Experimental Behavior:&lt;/strong&gt; Introducing a CLI flag allows developers to opt-in to new behavior, reducing risk and enabling gradual adoption.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By carefully respecting package privacy and controlling transformation scope, Node.js improves module safety and developer experience.&lt;/p&gt;




&lt;p&gt;This article is based on the changes introduced in the Node.js repository PR titled "module: add --experimental-strip-private-modules".&lt;/p&gt;

&lt;p&gt;Read the full breakdown on nossletter.tech.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://nossletter.tech/digest/node-63869-module-add-experimental-strip" rel="noopener noreferrer"&gt;Nossletter&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>modules</category>
      <category>typescript</category>
      <category>packagemanagement</category>
    </item>
    <item>
      <title>Seamless Model Discovery and Download from HuggingFace Hub in llama.cpp UI</title>
      <dc:creator>Priyadarshan Singh</dc:creator>
      <pubDate>Mon, 19 Oct 2026 05:58:00 +0000</pubDate>
      <link>https://dev.to/pdrojack/seamless-model-discovery-and-download-from-huggingface-hub-in-llamacpp-ui-2e8g</link>
      <guid>https://dev.to/pdrojack/seamless-model-discovery-and-download-from-huggingface-hub-in-llamacpp-ui-2e8g</guid>
      <description>&lt;h1&gt;
  
  
  Seamless Model Discovery and Download from HuggingFace Hub in llama.cpp UI
&lt;/h1&gt;

&lt;p&gt;Integrating external model repositories directly into machine learning tooling can drastically improve user experience and workflow efficiency. For users of the popular llama.cpp project, managing GGUF models—especially quantized ones with associated sidecar files—was previously a manual, error-prone process. This article dives into a recent enhancement that brings HuggingFace Hub model discovery and synchronized downloads into the llama.cpp UI, making model management intuitive and reliable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: Manual and Fragmented Model Downloads
&lt;/h2&gt;

&lt;p&gt;Before this change, llama.cpp users who wanted to leverage GGUF format models hosted on HuggingFace Hub faced several challenges. The UI lacked any way to browse or search the Hub’s model repository, forcing users to manually locate and download models outside the application. &lt;/p&gt;

&lt;p&gt;More critically, quantized models often come with additional "draft" sidecar files—like dflash or mtp—that optimize or complement the main model. Users had to manually track and download these sidecars separately, with no visual indication or download controls in the UI. This led to inconsistent states, missed files, and a cumbersome workflow.&lt;/p&gt;

&lt;p&gt;At the root, the existing model manager was not integrated with HuggingFace Hub’s APIs and did not model the relationship between main models and their sidecars. Download logic was isolated and unaware of these dependencies, making coordinated downloads and resumable controls impossible.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: Discover Models View and Coordinated Downloads
&lt;/h2&gt;

&lt;p&gt;This PR introduces a comprehensive Discover Models view within the llama.cpp UI that directly queries the HuggingFace Hub for GGUF models. Users can now search, filter, and view detailed metadata about available models without leaving the app. &lt;/p&gt;

&lt;h3&gt;
  
  
  UI Enhancements
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Discover Models View:&lt;/strong&gt; Presents a live list of GGUF models from HuggingFace Hub with search and filtering capabilities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Download Chips:&lt;/strong&gt; Each model entry features interactive download buttons that reflect real-time download states (e.g., queued, in progress, paused).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Draft Sub-lines:&lt;/strong&gt; When a model has associated draft sidecar files, these appear as sub-items under the main model entry, clearly indicating their relationship.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Settings Toggles:&lt;/strong&gt; Users can enable or disable the Discover integration and filter out unsupported decision models right from the settings.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Backend Download Logic
&lt;/h3&gt;

&lt;p&gt;The download subsystem, particularly in &lt;code&gt;common/download.cpp&lt;/code&gt;, was extended to recognize and handle tagged sidecar files linked to a main quantized model. This means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When a user initiates a download of a quantized model, the system automatically identifies and queues downloads for its draft sidecars.&lt;/li&gt;
&lt;li&gt;Download controls such as pause, resume, and cancel apply synchronously to both main and sidecar files, ensuring consistent states.&lt;/li&gt;
&lt;li&gt;Manual downloads of drafts are also supported, giving users flexibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By explicitly modeling these file sets as coordinated groups, the download manager maintains robust state tracking and error handling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Matters: Lessons for Integrating Complex External Resources
&lt;/h2&gt;

&lt;p&gt;This enhancement highlights key considerations when integrating external repositories with complex dependency relationships into an application UI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Model Related Files as Groups:&lt;/strong&gt; Treat main models and their auxiliary files as a single logical unit in both backend and frontend to maintain consistency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Synchronized Controls:&lt;/strong&gt; Download operations and UI states must be coordinated across all related files to avoid user confusion and partial states.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User-Centric Discovery:&lt;/strong&gt; Embedding search and filtering capabilities directly into the UI reduces friction and encourages adoption.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configurability:&lt;/strong&gt; Providing users toggles to enable/disable integrations or filter content respects diverse workflows and resource constraints.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For projects dealing with large, multipart downloads or external resource catalogs, these principles can greatly improve usability and reliability.&lt;/p&gt;




&lt;p&gt;This article is based on the PR "ui : Discover &amp;amp; Download Models from HF Hub" merged into the &lt;a href="https://github.com/ggerganov/llama.cpp" rel="noopener noreferrer"&gt;llama.cpp&lt;/a&gt; repository. &lt;/p&gt;

&lt;p&gt;Read the full breakdown on nossletter.tech.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://nossletter.tech/digest/llama.cpp-29584-ui-discover-download-models" rel="noopener noreferrer"&gt;Nossletter&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>ui</category>
      <category>huggingface</category>
      <category>downloadmanagement</category>
    </item>
    <item>
      <title>Extending llama.cpp to Support Reflection Beam-1.0-501B-A23B: Handling Complex MoE and Attention Architectures</title>
      <dc:creator>Priyadarshan Singh</dc:creator>
      <pubDate>Sat, 17 Oct 2026 13:30:31 +0000</pubDate>
      <link>https://dev.to/pdrojack/extending-llamacpp-to-support-reflection-beam-10-501b-a23b-handling-complex-moe-and-attention-32ca</link>
      <guid>https://dev.to/pdrojack/extending-llamacpp-to-support-reflection-beam-10-501b-a23b-handling-complex-moe-and-attention-32ca</guid>
      <description>&lt;h1&gt;
  
  
  Why Supporting Specialized Large Models Matters
&lt;/h1&gt;

&lt;p&gt;The rapid evolution of large language models (LLMs) has introduced increasingly complex architectures, often combining mixture-of-experts (MoE) routing, novel attention mechanisms, and specialized input/output formats. For open-source projects like llama.cpp, which aim to provide lightweight, efficient inference, adding support for these models is a non-trivial challenge. This article dives into how the Reflection Beam-1.0-501B-A23B model, with its intricate MoE and attention layers, was integrated into llama.cpp — revealing key engineering lessons for anyone extending LLM frameworks to handle cutting-edge architectures.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Challenge: Why Reflection Beam Wasn't Supported Initially
&lt;/h1&gt;

&lt;p&gt;Before this change, llama.cpp did not support the Reflection Beam-1.0-501B-A23B model. This model stands out for several reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mixture-of-experts (MoE) with top-8 expert selection:&lt;/strong&gt; Unlike simpler MoE implementations, this model uses a specialized routing mechanism that selects the top 8 experts per token, combined with sigmoid-based routing biases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interleaved attention layers:&lt;/strong&gt; It alternates sliding-window attention with NoPE (no positional encoding) attention layers, applying rotary positional embeddings (RoPE) selectively.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Power-law query scaling:&lt;/strong&gt; An optional feature that scales query vectors in attention layers with a power-law function to improve performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;New chat parser format:&lt;/strong&gt; The model uses a unique tool-call chat format requiring a dedicated parser.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These architectural and format differences meant that simply loading weights or running inference with existing llama.cpp code was impossible.&lt;/p&gt;

&lt;h1&gt;
  
  
  How the PR Tackled the Complexity
&lt;/h1&gt;

&lt;p&gt;The solution involved multiple coordinated enhancements across the codebase:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. New Model Implementation (src/models/beam.cpp)
&lt;/h2&gt;

&lt;p&gt;A dedicated model file was created to encapsulate the unique MoE and attention logic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;MoE FFN with grouped expert selection:&lt;/strong&gt; The code implements a top-8 expert selection per token, using a sigmoid routing mechanism that biases the expert scores. This differs from simpler MoE layers by requiring grouped computation and careful routing to efficiently select and combine expert outputs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Interleaved attention layers:&lt;/strong&gt; The model alternates between sliding-window attention (which focuses on local context windows) and NoPE attention (which omits positional embeddings). The implementation ensures that RoPE is applied only where appropriate, preserving the intended positional information.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Power-law query scaling:&lt;/strong&gt; This feature is implemented as an optional step in llama-graph.cpp, where query vectors in attention layers are scaled by a power-law function before computing attention scores. This subtle modification can improve the model's ability to focus on relevant tokens.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Converter Script (conversion/beam.py)
&lt;/h2&gt;

&lt;p&gt;To facilitate loading the Beam model weights into llama.cpp, a new converter script was added. This script translates the official Beam model weights into the GGUF format compatible with llama.cpp, including handling the MoE-specific parameters and attention layer weights.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Harmony-XML Chat Parser (common/parsers/harmony-xml.cpp)
&lt;/h2&gt;

&lt;p&gt;The Beam model uses a specialized chat format that includes tool-call markers. To support this, a new parser was introduced that detects these markers and correctly interprets the chat messages, enabling seamless interaction with the model's tool-calling capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Integration and Testing
&lt;/h2&gt;

&lt;p&gt;The new components were wired into the existing llama.cpp architecture with appropriate tests to ensure correctness. GGUF format support was extended to accommodate the Beam-specific model parameters, guaranteeing that loading and generation behave as expected.&lt;/p&gt;

&lt;h1&gt;
  
  
  Lessons Learned: Modularity and Format Awareness Are Key
&lt;/h1&gt;

&lt;p&gt;This integration highlights several important takeaways for LLM framework maintainers and contributors:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Modular architecture enables extensibility:&lt;/strong&gt; By isolating the Beam model logic in its own source file and adding specialized parsers and converters, the codebase remains maintainable and adaptable to future models with unique architectures.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Attention to routing and attention details is critical:&lt;/strong&gt; Complex MoE routing and interleaved attention mechanisms require careful implementation to preserve model semantics and performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Input/output format support matters:&lt;/strong&gt; Supporting new chat formats and tool-call protocols is as crucial as supporting the model architecture itself, especially for interactive or multi-modal models.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Testing and format compatibility:&lt;/strong&gt; Adding tests and ensuring compatibility with standard formats like GGUF helps maintain robustness and user confidence.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Supporting a model as specialized as Reflection Beam-1.0-501B-A23B in llama.cpp required extending the model graph logic, adding new routing and attention mechanisms, and implementing format-aware parsers. This work not only enables users to run this advanced model efficiently but also sets a foundation for integrating future complex architectures. For developers working on LLM frameworks, this case underscores the importance of modular design and comprehensive format support when adapting to the evolving landscape of large models.&lt;/p&gt;




&lt;p&gt;This article is based on the merged PR "model: add Beam (Reflection)" in the ggml-org/llama.cpp repository. Read the full breakdown on nossletter.tech.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://nossletter.tech/digest/llama.cpp-30670-model-add-beam-reflection" rel="noopener noreferrer"&gt;Nossletter&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>llamacpp</category>
      <category>mixtureofexperts</category>
      <category>attention</category>
      <category>modelconversion</category>
    </item>
    <item>
      <title>How Hugging Face's Transformers Added UltraBERT with Layer-Specific Rotary Embeddings</title>
      <dc:creator>Priyadarshan Singh</dc:creator>
      <pubDate>Fri, 16 Oct 2026 16:29:53 +0000</pubDate>
      <link>https://dev.to/pdrojack/how-hugging-faces-transformers-added-ultrabert-with-layer-specific-rotary-embeddings-4534</link>
      <guid>https://dev.to/pdrojack/how-hugging-faces-transformers-added-ultrabert-with-layer-specific-rotary-embeddings-4534</guid>
      <description>&lt;h2&gt;
  
  
  Why UltraBERT Integration Matters
&lt;/h2&gt;

&lt;p&gt;The Hugging Face Transformers library is a cornerstone for NLP research and applications, providing a unified interface for countless transformer architectures. But as models evolve, they often introduce nuanced architectural features that challenge existing abstractions. UltraBERT is one such model, distinguished by its dual rotary embedding scheme tailored for local and global attention layers. Integrating UltraBERT into Transformers not only unlocks new research possibilities but also highlights best practices for managing complex, layer-specific parameters in large model codebases.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: Handling Distinct Rotary Embeddings Per Layer
&lt;/h2&gt;

&lt;p&gt;Rotary embeddings are a powerful technique for injecting relative position information into transformer models. Most models use a single rotary embedding parameter set applied uniformly across layers. UltraBERT, however, innovates by employing two different rotary embedding theta values: one for local attention windows and another for global attention. This dual setup requires the model to maintain and apply separate rotary embeddings depending on the layer's attention type.&lt;/p&gt;

&lt;p&gt;Before this PR, the Transformers library did not support multiple rotary embeddings coexisting and being selectively applied per layer. The existing code assumed a single rotary embedding instance, making UltraBERT's unique requirement incompatible with the library's design.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: Modular Rotary Embeddings with ModuleDict
&lt;/h2&gt;

&lt;p&gt;To address this, the PR introduced UltraBERT as a new model class within Transformers, building on the modular design of existing models like ModernBERT and EuroBERT. This reuse minimized code duplication and leveraged proven architectures.&lt;/p&gt;

&lt;p&gt;The key technical innovation was the use of a &lt;code&gt;ModuleDict&lt;/code&gt; to store rotary embeddings keyed by their type—specifically, separate entries for "local" and "global" rotary embeddings. This design allows the model to initialize, store, and access multiple rotary embedding parameters cleanly and efficiently.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;modeling_ultrabert.py&lt;/code&gt;, the &lt;code&gt;ModuleDict&lt;/code&gt; is set up during model initialization to contain two rotary embedding modules, each initialized with the appropriate theta values for local and global attention. During the forward pass, UltraBERT applies the correct rotary embedding by selecting from the &lt;code&gt;ModuleDict&lt;/code&gt; based on the layer's attention configuration.&lt;/p&gt;

&lt;p&gt;This approach avoids duplicating entire model implementations for each rotary embedding variant. Instead, it provides a flexible container that elegantly manages layer-specific parameter variations.&lt;/p&gt;

&lt;p&gt;The PR also integrated UltraBERT's configuration, pretrained model weights, and added support for common heads like Masked Language Modeling and Sequence Classification, making the model fully functional within the Transformers ecosystem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaway: Embrace Modular Containers for Layer-Specific Parameters
&lt;/h2&gt;

&lt;p&gt;UltraBERT's integration underscores a broader engineering lesson: when dealing with models that require distinct parameters per layer or per functional unit, designing modular and flexible parameter containers is crucial. Structures like PyTorch's &lt;code&gt;ModuleDict&lt;/code&gt; enable clean separation and management of multiple parameter sets without bloating the codebase or introducing fragile conditionals.&lt;/p&gt;

&lt;p&gt;This pattern not only improves maintainability but also facilitates future extensibility. New variants with additional parameter groups or attention mechanisms can be integrated by extending the container rather than rewriting core model logic.&lt;/p&gt;

&lt;p&gt;For practitioners extending large model libraries, this approach balances code reuse with the flexibility needed to accommodate cutting-edge research innovations.&lt;/p&gt;




&lt;p&gt;Credit to the Hugging Face Transformers team for the original UltraBERT integration PR.&lt;/p&gt;

&lt;p&gt;Read the full breakdown on nossletter.tech.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://nossletter.tech/digest/transformers-49596-integrate-the-ultrabert-architecture" rel="noopener noreferrer"&gt;Nossletter&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>transformers</category>
      <category>pytorch</category>
      <category>nlp</category>
      <category>modelarchitecture</category>
    </item>
  </channel>
</rss>
