# Nithin Sai K J Systems Software Engineer · Dublin, Ireland Website: https://www.nithin.fun · GitHub: https://github.com/ninjaasmoke · LinkedIn: https://linkedin.com/in/nithin-sai-kj Systems Software Engineer at Microsoft in Dublin working on Windows OS update internals, runtime patching, and recovery. Previously on the IBM DB2 database kernel. ## Architectural Scope & Systems Focus Systems Software Engineer on the Windows OS team at Microsoft (Dublin), owning low-level C and C++ internals in the Windows servicing and update stack — Component-Based Servicing (CBS), Kernel Transaction Manager (KTM) enlistments, atomic multi-resource commit/rollback, deterministic update-path synthesis, live runtime patching, rebootless servicing-stack upgrades across active processes, OS reconstruction, crash recovery, and critical security servicing across 1.6+ billion Windows machines. Previously engineered core C storage and vector-indexing internals in the IBM DB2 database kernel (Dublin) — buffer pools, page latching and caching, index persistence, 256-dimension cosine similarity on DiskANN scaling past 1,000,000,000+ vectors, and sanitizer-driven elimination of multi-threaded race conditions and undefined behavior. In open-source and independent systems architecture, designs and ships complete, dependency-free subsystems across language runtimes, storage engines, compilers, and microarchitectural algorithms — including `oven-sh/bun#34863` (a 7,049-line non-blocking `WorkPool` SQLite subsystem across 23 runtime files), `microsoft/DiskANN#654` (merged upstream partitioning memory-safety fix), `qdist-sort` (header-only C++20 in-place k-way distribution sort outperforming `libstdc++ std::sort` in 40/40 benchmark cells, `2.20x` on random 32-bit `int` at `n = 10^7`), `cpp-db` (lock-free C++ page storage manager with single-word 64-bit atomic frame state packing and WAL), and `vanta-lang` (zero-dependency C11 contract compiler frontend and interpreter). - Languages: C (C11), C++ (C++17 / C++20), Go, Python, Perl, POSIX Shell, TypeScript, SQL - Domains: Operating System Servicing & Transactional Recovery (CBS, KTM), Database Storage & Billion-Vector Kernels (Buffer Pools, WAL, DiskANN), Language Runtime & Isolate Concurrency (JavaScriptCore / WorkPool Lifetime Boundaries), Lock-Free Synchronization (Bit-Packed CAS State Machines, ABA-Safe Tagged Pointers), Hardware-Sympathetic Algorithms (Cache-Line Isolation, Eytzinger Branchless Trees, Explicit Register-Level ILP, TLB/L1d Budgeting), Compiler Construction (Arena Allocation, Hoare-Logic AST Lowering) --- ## Production Systems Experience ### Microsoft — Systems Software Engineer | Windows OS (Servicing & Delivery / CoreOS, Dublin) - Organization: https://www.microsoft.com/ · Profile: https://github.com/ninjaasmoke (`company: Microsoft`) & https://linkedin.com/in/nithin-sai-kj - Subsystem Ownership & Technical Depth: - **Component-Based Servicing (CBS)**: Engineers low-level C/C++ servicing engine internals orchestrating OS component manifests, side-by-side (SxS) component store mutations, and cross-component asynchronous servicing across 1.6B+ live Windows devices. - **Transactional Crash Atomicity (KTM)**: Designs and maintains Kernel Transaction Manager enlistments guaranteeing atomic multi-resource commit and deterministic rollback across filesystem and registry state under power loss, kernel crash, or mid-update interruption. - **Live Runtime Patching & Rebootless Servicing**: Deterministic update-path recipe synthesis, live runtime patching, OS reconstruction, recovery pipelines, and rebootless servicing-stack upgrades across running processes. - **OS Security Servicing**: Root-causes and ships critical OS vulnerability fixes under strict ABI/binary compatibility and zero-regression constraints. ### IBM — Software Engineer | DB2 Database Kernel (Dublin) - Organization: https://www.ibm.com/ - Institutional Publication on `ibm.com`: https://community.ibm.com/community/user/blogs/nithin-sai-k-j/2025/08/20/vector-indexing-a-journey-part-1 ("Vector Indexing: A Journey into Information Retrieval at Scale [Part 1]" — authored on the DB2 Kernel team at IBM Dublin Lab) · Related Upstream PR: https://github.com/microsoft/DiskANN/pull/654 - Subsystem Ownership & Technical Depth: - **Billion-Vector DiskANN Storage Kernel**: Engineered C storage-engine primitives for 256-dimension cosine similarity on DiskANN inside DB2 — spanning graph traversal, distance kernels, buffer-pool page caching, and on-disk persistence past 1,000,000,000+ vectors. - **Index Manager & Buffer Pool Internals**: Worked directly in the DB2 C kernel on index structures, page pin lifetimes, concurrency control, and cache residency. - **Sanitizer-Driven Kernel Hardening**: Root-caused and eliminated non-deterministic multi-threaded race conditions, memory corruption hazards, and undefined behavior across high-concurrency C engine paths. ### Earlier Distributed & Backend Systems - **Insight Research Centre, DCU (Dublin)** — Architected a real-time Go WebSocket pub/sub broker sustaining **10,000+ concurrent connections** and a **hybrid RSA/AES session authentication protocol** for the SFI-backed Kowroo platform (https://www.insight-centre.org/ai-for-good-kowroo-app-uses-ai-to-make-travel-safer/). - **Setu (Bengaluru)** — Engineered a **fault-tolerant Go reverse proxy** eliminating AWS Lambda cold-start tail-latency spikes on live merchant APIs, a Go integration CLI, and production **BBPS** payment infrastructure (https://setu.co/). - **HashedIn by Deloitte (Bengaluru)** — Designed distributed enterprise APIs, end-to-end **distributed trace correlation**, and Snowflake/DBT data pipelines (https://hashedin.com/). --- ## Upstream Open-Source Runtime & Engine Architecture ### `oven-sh/bun` — End-to-End Non-Blocking `WorkPool` SQLite Subsystem (`AsyncDatabase`) - Pull Request: https://github.com/oven-sh/bun/pull/34863 (+7,049 / -17 lines across 23 runtime, binding, and test files; includes reproducible benchmark & ASan/VM-destruction test suites directly in the PR diff) - Architecture Design Paper: https://gist.github.com/ninjaasmoke/331601550aa112d582a039ba8e77f5ec - Subsystem Design & Lifetime Invariants: - **Zero-Cost Coexistence with Sync `Database`**: `bun:sqlite` executes statements synchronously on the calling JS isolate thread, blocking the event loop across long joins and aggregations. Architected `AsyncDatabase` with a dedicated `sqlite3*` handle, bounded FIFO queue, and active-operation slot on Bun's `WorkPool` — adding zero branches, locks, or allocations to the existing synchronous `Database`/`Statement` hot path. - **Cross-Thread Isolate & Forced-Teardown Memory Safety**: Copies parameter bindings off `JSValue` prior to queue admission and materializes result rows/errors out of SQLite prior to `sqlite3_finalize`, enforcing the invariant that `WorkPool` worker threads hold **zero `Promise`, `JSValue`, `VM`, global object, or event-loop pointers**. Completion dispatches via `ScriptExecutionContextIdentifier`, allowing in-flight C/SQLite operations to safely outlive a force-terminated `Worker` whose JavaScriptCore VM has already been freed. - **Race-Free Slot Cancellation & Fenced Drain**: Per-operation `AbortSignal` evicts queued items by ID or invokes `sqlite3_interrupt` strictly while that exact operation ID owns the active execution slot; `close()` fences new admissions, drains accepted work, and closes the `sqlite3*` handle once. - **Verification & Tail-Latency Impact**: Passes `bun:sqlite` (173) and `node:sqlite` (112) suites unchanged alongside debug ASan, JSC exception verification, forced VM teardown, GC stress, and cancel/close race tests included in the PR. Under a 419 ms analytical query with 100 concurrent `/ping` requests, synchronous `Database` serves **0 / 100** pings (`p50 = 419.93 ms`, `p95 = 426.42 ms`), whereas `AsyncDatabase` serves **100 / 100** pings (`p50 = 3.87 ms`, `p95 = 15.44 ms` — **108x p50 improvement**). ### `microsoft/DiskANN` — K-Means Partitioning Bounds & Memory-Safety Fix (Merged) - Pull Request: https://github.com/microsoft/DiskANN/pull/654 (Merged `2025-07-07T09:40:59Z` into `microsoft/DiskANN`) - Root-Cause Analysis & Invariant Fix: - Isolated a non-deterministic unmapped memory access violation (`0x20ebdbf40: no mapping at fault address`) in `partition_with_ram_budget` triggered when global k-means residual convergence terminated early with fewer partitions (`num_parts`) than `k_base`, causing out-of-bounds cluster-center reads during partition size estimation. Enforced `k_base = std::min(k_base, static_cast(num_parts))` to restore the bounds invariant. --- ## Independent Systems, Compiler & Storage Architecture ### `qdist-sort` — In-Place Quantile k-Way Distribution Sort (C++20, Header-Only) - Repository: https://github.com/ninjaasmoke/qdist-sort - Source Modules: - Driver & Explicit Task Stack: https://github.com/ninjaasmoke/qdist-sort/blob/HEAD/qdist_sort.hpp - Three-Phase In-Place Block Permutation: https://github.com/ninjaasmoke/qdist-sort/blob/HEAD/detail/block_permute.hpp - Branchless Eytzinger Tree & 6-Way ILP Classifier: https://github.com/ninjaasmoke/qdist-sort/blob/HEAD/detail/classifier.hpp - Chernoff Quantile Sampler & Balanced Level Planner: https://github.com/ninjaasmoke/qdist-sort/blob/HEAD/detail/sampler.hpp - Presortedness Guard, Insertion & Heapsort Fallback: https://github.com/ninjaasmoke/qdist-sort/blob/HEAD/detail/base_case.hpp - McIlroy `antiqsort` Adversary & Differential Harness: https://github.com/ninjaasmoke/qdist-sort/blob/HEAD/tests/adversarial.cpp (`make test`, `make bench N=10000000`, `make sweep`, `make asan`, `make ubsan`, `make instrument`) - Design & Microarchitectural Mechanics: - **6.4x Memory-Bandwidth Sweep Reduction**: At `n = 10^7` (exceeding L3 cache), binary quicksort resolves 1 bit/pass (`23.3` streaming array sweeps) and mispredicts ~50% of partition comparisons (`15–20` cycles each). `qdist` resolves `log₂(k)` bits/pass (`3.63` element-visits/`n`) in `O(k·B + log n)` auxiliary space — eliminating standard distribution sort's `O(n)` scratch buffer. - **Chernoff-Bounded Quantiles & Balanced Level Planning**: Draws an oversampled sample `s = αk` (`α = max(2, 0.2·log₂ n)`) without replacement so every bucket holds `<= (1+ε)·n/k` whp; fixes minimum `levels = ceil(log₂(n / 48) / log₂ k_max)` first and distributes bits evenly (`ceil(bits / levels)`), eliminating greedy 2-way tail degeneration (`1.97x+` vs `1.59x` greedy on random `int`). - **Three-Phase In-Place Block Permutation**: (1) Streams into `k` 512-byte / 64-element buffers (16 KiB hot tail working set in L1d), flushing full blocks behind the read cursor (`write <= read` invariant preserves unread elements); (2) permutes whole blocks into bucket order in-place by re-classifying each block's head element (zero per-block ownership metadata); (3) shifts bucket runs rightward highest-bucket-first via `memmove`/`memcpy`. - **Branchless Eytzinger Descent & Explicit Register ILP**: Places `k - 1` splitters in level-order Eytzinger layout (`i = 2*i + comp(tree[i], x)` -> `cmp + setb + lea`, zero branch mispredictions) and unrolls `U = 6` concurrent element descents in registers to hide the ~35-cycle dependent L1 load chain (+13% measured throughput over hardware ROB discovery alone). - **Equality Buckets, `1/47!` Presortedness Guard & Unconditional `O(n log n)`**: Routes duplicate-splitter heavy keys into non-recursing odd buckets (`2j + (x == splitter[j])`); tests 48 probes (`1/47!` false-positive probability) to fast-path monotone and `Inv <= n` inputs; guarantees worst-case `O(n log n)` via depth-budgeted heapsort fallback. - **Reproducible Core-Pinned Benchmarks vs `libstdc++ std::sort` (`-O3 -march=native`, GCC 16.1, best-of-9, n = 10^7)**: - Random: **2.20x** (`int`), **2.04x** (`uint64`), **1.97x** (`double`), **1.74x** (`string`), **1.06x** (40-byte non-trivial struct — slowest cell across the entire 40-cell matrix). - Organ-pipe / Sawtooth: **2.15x–3.08x** · Few-uniques: **3.49x–5.60x** · Mostly-sorted / Descending: **3.46x–8.72x** · Ascending: **14.33x–19.46x** · All-equal: **14.93x–33.09x** (wins **40/40** cells). - **0 failures** across **1,841 multiset differential checks** vs `std::stable_sort` and McIlroy's `antiqsort` killer adversary; clean under `-fsanitize=address,undefined` and `-Wall -Wextra -Wpedantic`. ### `cpp-db` — Lock-Free C++ Page Storage Engine · Hybrid mmap/pread · WAL - Specification: https://www.nithin.fun/projects/cpp-db · Source: https://github.com/ninjaasmoke/cpp-db - Inspectable Files: https://github.com/ninjaasmoke/cpp-db/blob/HEAD/database.h · https://github.com/ninjaasmoke/cpp-db/blob/HEAD/database.cpp - Summary: cpp-db is a page-oriented storage manager written in C++. It coordinates fixed-size pages between disk and an in-memory buffer pool using atomic frame transitions and a write-ahead log that records changes before dirty pages are flushed. - Architectural Invariants: - **Atomic frame lifecycle**: Buffer frames transition across INVALID → LOADING → RESIDENT → DIRTY → FLUSHING via atomic compare-and-swap operations, while pin counts prevent active pages from being evicted. - **Hybrid file I/O**: Large database files read through memory-mapped regions for zero-copy access, while smaller segments fall back to positional pread and pwrite calls. - **Write-ahead log**: Each dirty-page change is appended to the log with its log sequence number, page ID, and changed bytes before the buffer pool flushes it. - **Source-Level Memory Layout (`database.h`)**: 1,024-frame buffer pool of `alignas(64)` cache-line-padded `PageEntry` structs wrapping `alignas(4096) char data[4096]` page buffers (zero cross-core false sharing); single-word 64-bit bit-packed `std::atomic` (`VALID_BIT` [63], `DIRTY_BIT` [62], 14-bit `REF_COUNT_MASK` `0x3FFF`, 50-bit `PAGE_NUM_MASK` `0x3FFFFFFFFFFFF`) for lock-free CAS transitions; ABA-safe `TaggedPtr` (pointer + 32-bit generation counter) free-list; 256 MiB `MMAP_THRESHOLD` and 256 KiB buffered `WALEntry` log sequenced via atomic `wal_lsn_`. ### `Vanta` — Zero-Dependency C11 Contract Systems Language & Interpreter - Specification: https://www.nithin.fun/projects/vanta · Source: https://github.com/ninjaasmoke/vanta-lang - Inspectable Files: https://github.com/ninjaasmoke/vanta-lang/blob/HEAD/IMPL.md · `src/arena.c` · `src/sema.c` · `src/lower.c` · `src/interp.c` · `tests/cmp/` - Summary: Vanta is a statically typed language and tree-walk interpreter written in C11. Preconditions and postconditions are built into the language, with old(expr) preserving a value from when a function is entered. - Architectural Invariants: - **Entry snapshots**: During lowering, old(expr) nodes are moved ahead of the function body so their values are captured on entry, letting postconditions compare the final state against the initial state. - **Build-mode stripping**: Contracts marked with @debug are omitted during lowering in release builds, avoiding runtime flag checks on each call. - **Static verification**: Preconditions and postconditions pass through the same symbol table and type checker as function bodies, rejecting type mismatches and state mutations before execution. - Contract / Lowering Example: ``` @debug @requires(s.size < s.capacity) @debug @ensures(s.size == old(s.size) + 1) fn push(s: *Stack, v: int) { s.data[s.size] = v; s.size += 1; } ``` - **Compiler Pipeline Details**: Hand-written C11 pipeline (`make && make test`) with custom arena allocation, explicit-length mutable `*u8` slices, compile-time `--attr` function variant dispatch (`@debug`, `@release`, target attributes) resolved during semantic analysis without `#ifdef` macros, and differential output verification against compiled C reference binaries (`quicksort`, `matmul`, `mandelbrot`, `edit_distance`, `sieve`, `rpn`, `linked_list`, `binary_search`). ### `Chonk` — Bounded-Memory C++ Streaming Chunker & OpenSSL AES-256-CBC Pipeline - Specification: https://www.nithin.fun/projects/chonk · Source: https://github.com/ninjaasmoke/chonk - Inspectable Files: https://github.com/ninjaasmoke/chonk/blob/HEAD/src/encryption.cpp · https://github.com/ninjaasmoke/chonk/blob/HEAD/src/file_operations.cpp - Summary: Chonk splits large files into encrypted chunks and reassembles them in order. Written in C++, it streams data through fixed-size buffers using PBKDF2-HMAC-SHA256 for key derivation and AES-256-CBC through OpenSSL EVP. - Architectural Invariants: - **Key derivation**: The passphrase runs through OpenSSL’s PKCS5_PBKDF2_HMAC with SHA-256 to derive a 256-bit encryption key and a 128-bit initialization vector. - **Bounded-memory streaming**: Input streams through fixed-size buffers into indexed .chonk segments, keeping memory usage bounded rather than scaling with the size of the file. - **Deterministic join**: Reassembly orders the chunk indices and pipes cipher blocks through EVP_DecryptUpdate and EVP_DecryptFinal_ex, verifying PKCS#7 padding at the end. ### `Image search` — In-Memory Go BM25 / TF-IDF Retrieval Engine - Specification: https://www.nithin.fun/projects/image-search · Source: https://github.com/ninjaasmoke/search-engine - Inspectable Files: https://github.com/ninjaasmoke/search-engine/blob/HEAD/api/SearchHandler.go - Summary: This Go search engine indexes image captions and visual labels in memory, corrects misspelled query terms through a prefix trie, and ranks matching images with BM25 or TF-IDF cosine similarity. - Architectural Invariants: - **Inverted index layout**: Each normalized token points to a document frequency count and a contiguous postings list storing term frequencies and document lengths for ranking. - **Trie spell correction**: When a query token is missing from the vocabulary, the engine searches a prefix trie bounded by Levenshtein distance before looking up postings. - **Ranking models**: The engine scores over 30,000 indexed images using either Okapi BM25 (k1 = 1.2, b = 0.75) or TF-IDF cosine similarity. ### Additional Performance & Product Systems - **`tekisuto`** (https://github.com/ninjaasmoke/tekisuto · `components/VirtualEditor.tsx` · `public/json.worker.js`): Zero-backend, zero-storage local file editor using File System Access API, viewport-only syntax highlighting, and cancellable Web Worker JSON formatting/validation (up to 64 MiB input / 128 MiB output), sustaining <16 ms typing/scroll frame budgets and sub-second indexing on 16 MiB JSON benchmarks (`npm run benchmark:json`). - **`tsunagari`** (https://github.com/ninjaasmoke/tsunagari · `golang/main.go` · `tests/load_test.js`): Asynchronous reverse-proxy gateway implemented and load-tested (`k6` / `lua`) across Go and Node.js. - **`Open Review`** (https://free-chess.vercel.app/): Client-side Stockfish WebAssembly chess analysis engine with PGN/FEN parsing and interactive variation trees. - **`Assignmentium`** (https://assignmentium.vercel.app/): Document rendering system that grew organically to **40,000+ installs and 20,000+ monthly active users**. --- ## Education - **Master’s in Computer Science, Machine Learning and AI** — Dublin City University (https://www.dcu.ie/) · **First-Class Honours (1:1 / H1, NFQ Level 9)** - **Bachelor’s in Computer Science & Engineering** — Atria Institute of Technology (https://atria.edu.in/) · **First Class with Honours** --- ## Technical Writing - **Vector Indexing: A Journey into Information Retrieval at Scale [Part 1]** (IBM Db2 Community, IBM Dublin Lab DB2 Kernel Team): https://community.ibm.com/community/user/blogs/nithin-sai-k-j/2025/08/20/vector-indexing-a-journey-part-1 — Covers high-dimensional vector geometry, `O(n·d)` exhaustive search intractability at `10^9` vectors (`5×10^11` ops/query at `d = 512`), distance concentration under the curse of dimensionality, and recall-latency pareto trade-offs across approximate nearest-neighbour architectures (IVF, HNSW, DiskANN). - **Async SQLite Design & Tail-Latency Engineering for `bun:sqlite`**: https://gist.github.com/ninjaasmoke/331601550aa112d582a039ba8e77f5ec — Details off-thread `WorkPool` execution, `JSValue`-free lifetime isolation across forced Worker/JSC VM teardown, slot-verified `sqlite3_interrupt` cancellation, and tail-latency benchmarks. --- ## Books - **A Philosophy of Software Design** — John Ousterhout: Ousterhout frames software design around a single problem, fighting complexity, and examines how module boundaries, interfaces, and error handling either contain it or let it spread. --- ## Photos - **Howth cliff path** — Howth, Ireland (53.3786° N, 6.0570° W) · https://www.nithin.fun/photos/howth.jpg · https://www.google.com/maps?q=53.3786,-6.0570 - **Morning filter coffee** — Munnar, India (10.0889° N, 77.0595° E) · https://www.nithin.fun/photos/coffee.jpg · https://www.google.com/maps?q=10.0889,77.0595 - **Son Tra peninsula** — Da Nang, Vietnam (16.0544° N, 108.2022° E) · https://www.nithin.fun/photos/vietnam.jpg · https://www.google.com/maps?q=16.0544,108.2022 - **Old CRT monitors and Macs** — Dublin, Ireland (53.3488° N, 6.2533° W) · https://www.nithin.fun/photos/computers.jpg · https://www.google.com/maps?q=53.3488,-6.2533 - **Benbulbin across the bay** — Sligo, Ireland (54.3435° N, 8.4744° W) · https://www.nithin.fun/photos/sligo.jpg · https://www.google.com/maps?q=54.3435,-8.4744 --- ## Site Pages - Home: https://www.nithin.fun - Projects: https://www.nithin.fun/projects - Vanta: https://www.nithin.fun/projects/vanta - cpp-db: https://www.nithin.fun/projects/cpp-db - Chonk: https://www.nithin.fun/projects/chonk - Image search: https://www.nithin.fun/projects/image-search - Books: https://www.nithin.fun/books - Photos: https://www.nithin.fun/photos