algorithmic complexity vs hardware reality

Big-O lies: cache locality and branch prediction beat algorithmic complexity on real CPUs ACCU Conference
TL;DW
  • Algorithmic complexity alone doesn't predict real-world performance; modern CPUs depend on cache locality, branch prediction, and hardware constraints.
  • Vector operations outperform hash tables on small datasets (10K elements) due to better cache locality; hash table advantage emerges only at millions of elements.
  • Branch predictors use TAGE-SCL with four predictors inside modern CPUs, eliminating need for manual branch optimization in most cases.
  • Amortized complexity (like vector push_back) uses potential functions to hide reallocation costs; O(1) average doesn't mean O(1) every operation.
  • SIMD and parallel execution often regress performance unless workload exceeds millions of elements; single-threaded code typically optimizes better.
  • Cache misses cause performance valleys in multi-threaded code; adding threads beyond saturation point increases overhead faster than throughput.
  • Bloom filters and bitmaps enable cache-friendly set membership without allocating full hash tables; bitsets best if size known at compile time.
  • Bucketing large arrays into smaller chunks (3x faster than naive approaches) restores cache efficiency by keeping working set within L1/L2.
  • Division costs ~20x more cycles than addition on CPUs; multiplication 2x faster than division for floating-point; compilers auto-optimize integer shifts.
  • Modern C++26 SIMD eliminates manual CPU instruction writing via overloaded operators, but overhead significant unless data-parallel workload exceeds threshold.

Alex Dathskovsky at ACCU walks through concrete benchmarks where O(n²) cache-friendly code beats O(n) hash-table solutions, vectors outperform hash maps 3.6x on histograms, and single-threaded code beats parallel accumulation—then covers bitmap filtering, bucketing, and bit-packing as hardware-aware alternatives.

SDLC restructuring for AI coding

Somnio Software restructures 70-person Flutter shop's SDLC after LLMs cut 2-week builds to 1 day droidcon Berlin
TL;DW
  • Spec-driven development with heavy planning phase reduces build time dramatically—authentication features previously templated now take hours vs. days; complex tasks compressed from weeks to single days.
  • SDLC restructured into four phases (Explore, Plan, Code, Commit) with role ownership shifts: PMs write specs for LLMs, tech leads define architecture, developers become agent orchestrators, QA validates.
  • Build a lightweight, project-specific harness containing instructions (MD files), skills/sub-actions, tools/APIs, and hooks—kept lean to avoid context bloat while enabling predictable LLM output.
  • Create separate pre-commit validation environment where agents run code review, linting, testing before PR submission, keeping CI minimal and reducing token burn on deterministic checks.
  • Measure token spending, PRs opened, and lines touched against actual outcomes (merges to main, client value delivered)—token count alone doesn't guarantee quality; use metrics to coach best practices or justify capacity increases.
  • Parallel agent execution with sub-actions optimizes context window usage and reduces costs compared to sequential task execution.
  • Technical debt and security health checks run continuously via AI-powered audits; measurable baselines track code quality improvements independent of developer engagement.
  • Developers shift from low-level syntax/framework details to high-level architecture and context provision; easier framework version upgrades and ability to tackle previously infeasible projects with same team size.
  • Three-part takeaway: (1) Build your own harness for predictability, (2) accept hand-coding is no longer the job—opens ambitious project scope, (3) maintain ownership and responsibility for delivered code regardless of AI involvement.

With build time no longer the bottleneck, Somnio shifted focus to spec-driven planning and QA, retooled roles so PMs write harness specs and devs orchestrate agents, and published an open-source harness. New metrics map token spend to shipped PRs, not lines of code.

hallucination-proof AI architecture

Kepler architects LLM systems where models plan but deterministic code retrieves all numbers AI Engineer
TL;DW
  • Hallucination is a feature, not a bug—it's alpha. The real problem is structural: models lack access to your firm's internal data and can't be held accountable for wrong outputs.
  • Three sources of wrong numbers: retrieving wrong documents, extracting wrong numbers from right documents, and poor arithmetic. Each requires different architectural fixes.
  • Models should plan and retrieve but never generate numbers directly. Use deterministic tools and code to compute—don't rely on token prediction for math.
  • Pre-process unstructured data into structured stores with pointers to facts. Models dereference these pointers; if a pointer doesn't exist, the number cannot be generated.
  • Combine ANN + BM25 retrieval, reciprocal ranking, and cross-encoders to search wide across 200 candidate documents, then narrow—LLMs naturally do expensive depth-first search instead.
  • Security-critical: scope searches by tenant, prevent impersonation, validate document freshness, enforce allowlists, and populate indexes. Missing these causes cross-firm data leaks.
  • Post-processing verification checks each citation at search time, correcting or refusing it. Refusals dropped drastically when models couldn't dereference pointers.
  • Ask vendors: Does the model write pointers? Can you click a number to verify source? Are all citations and arithmetic checked? What happens to facts from nowhere?
  • 80% of finance execs trust AI-generated numbers, but 31% find errors—trust requires accountability and verifiable sources, not just RAG platforms.
  • Wall Street adoption stalled because tools format PowerPoints, not build end-to-end DCFs. Verification infrastructure unlocks real AI value in finance.

Hallucination is structural: probabilistic models will fabricate plausible numbers. Kepler's fix forbids models from generating numeric values directly — models identify pointer references to structured data stores, deterministic code dereferences them, and post-processing rejects any number without a traceable source. Covers tenant isolation and three retrieval failure modes.