- model
- lavisahu.com/lab
- object
- no. 001 — tp–7 field recorder
- stations
- 7 (3 live · 4 games)
- essays
- 5
- repos
- 8
- commits
- 1,184
- rule
- show the diff, not the pitch
07lab/ instruments & experiments
Real things, taken apart to see how they work.
Every tool and game is a station. Turn the green knob, or press a key.

On air: Bullwhip Visualizer, 90.0 MHz
90.0 mhz · Live · 2 levers
Demand noise and the number of tiers: see the swing grow upstream.
Customers barely move. Watch what the ordering does to everyone upstream. Real simulation, the same engine as the Beer Run game.
Five frameworks, each written up from a real source.
00:00The demand signal reaching your suppliers is noisier than the demand your customers generated, and you can measure the gap.
P&G's planners noticed something odd: retail demand for Pampers was nearly flat week to week, but P&G's own orders to its raw-material suppliers swung wildly. Trace the same pattern up any multi-tier supply chain and each tier's orders vary more than the tier below it. Jay Forrester had already modeled the phenomenon mathematically in 1961's Industrial Dynamics, decades before the industry had a name for it. Hau Lee, V. Padmanabhan and Seungjin Whang gave it one in two 1997 papers, along with a measurable ratio and a short list of testable causes.
P&G's Pampers order data is the anecdote that made the effect famous, but Forrester's Industrial Dynamics had already shown the underlying math in 1961. Small, steady demand at the retail end can produce large, erratic swings by the time it reaches raw-material suppliers, purely as an artifact of how each tier reacts to the tier below it. Lee, Padmanabhan and Whang formalized this in “Information Distortion in a Supply Chain” (Management Science, 1997) and “The Bullwhip Effect in Supply Chains” (Sloan Management Review, 1997), turning an observed pattern into a diagnosable one.
Bullwhip Ratio = Var(orders you place) ÷ Var(demand you receive). A ratio near 1 means you're passing demand through cleanly; well above 1 means you're manufacturing volatility your own customers never created. Here is an illustration with round numbers: if your weekly demand variance is 400 units² and your purchase-order variance to your supplier is 1,800 units², your ratio is 4.5, so your supplier is holding capacity for swings 4.5x wilder than what your customers are doing. Run the same two columns on your own order history and demand history to get your real number.
Lee, Padmanabhan and Whang name four: demand-signal processing (each tier re-forecasts off the tier above it instead of true end demand, compounding every tier's own noise), order batching (periodic or EOQ-driven ordering turns steady demand into lumpy orders), price fluctuation (forward-buying during promotions pulls future demand into the present), and shortage gaming (rationing during scarcity triggers inflated orders that evaporate once supply normalizes). Demand-signal processing and order batching are usually the two you can fix without a contract renegotiation, by sharing real POS/consumption data downstream and moving to smaller, more frequent replenishment cycles.
So what
Compute the ratio on your own two columns — demand variance vs. your own order variance to your supplier — before your next S&OP cycle. A ratio above 1 means your orders are noisier than your demand. The further above 1, the more working capital you spend protecting your supplier from volatility you created, not volatility your customer created.
Sources
00:00Resilience isn't a risk register — it's a comparison of two numbers per critical node: how long that node takes to come back online (TTR) against how long you can survive without it (TTS).
Most resilience programs produce a list of risks with a red/amber/green color and stop there. Yossi Sheffi's work at MIT's Center for Transportation and Logistics gives the field a pair of numbers to compute instead. The 2011 Tohoku earthquake's effect on the global auto industry is the clearest public illustration of what happens when nobody calculated them in advance.
Time-to-Recover (TTR) is how long it takes a disrupted node (a supplier, a plant, a port, a single-source component) to return to normal output. Time-to-Survive (TTS) is how long the business can keep operating on existing inventory, alternate sources, or substitute product before the disruption reaches customers. Sheffi laid this out in The Resilient Enterprise (2005) and extended it in The Power of Resilience (2015). The finding that changes how you prioritize: rank risk by the gap where TTR exceeds TTS, not by probability or spend.
Renesas Electronics' Naka, Japan plant supplied roughly 40% of the world's automotive microcontrollers; its N2 building alone accounted for about 20% of that global market. The March 2011 Tohoku earthquake took the plant offline. Every Toyota plant in Japan shut down completely for two weeks; Toyota's global output fell 78% year-over-year in April 2011. Domestic Japanese production didn't return to near-normal until July, wasn't fully restored until September, and global output didn't normalize until roughly November to December. That is a TTR of close to nine months end-to-end for a single-source node, far past any TTS a just-in-time automotive supply chain had built in.
Start with your bill of materials, flag every single-sourced or geographically concentrated node, and estimate TTR per node by asking the supplier how long qualifying an alternate or repairing the facility would take. Don't guess. Then estimate your own TTS against current safety stock and dual-source options. Prioritize by the size of the TTR-minus-TTS gap, not by which supplier sends you the biggest invoice.
So what
Anything where TTR clearly exceeds TTS is a live risk regardless of probability — that's the shortlist for your next resilience investment, not a probability-weighted heatmap.
Sources
00:00Every item you buy sits somewhere on two axes, how much it affects your profit and how risky its supply is, and that position alone should decide your negotiating posture, not gut feel or whoever argues loudest in the sourcing meeting.
Peter Kraljic introduced the matrix in “Purchasing Must Become Supply Management,” Harvard Business Review, 1983. He argued that procurement needed a portfolio approach the same way finance already had one for investments. Four decades later, it's still the default starting point most procurement functions reach for, and for a specific reason: it forces a decision, where a risk score just gives you a number to stare at.
Profit Impact (purchase volume, share of total cost, effect on final product quality) sits on one axis; Supply Risk (number of available suppliers, logistical complexity, price volatility, geopolitical exposure) sits on the other. The four resulting quadrants each carry a distinct strategy: non-critical (low/low: streamline, minimize administrative cost), leverage (high impact/low risk: exploit buying power through competitive bidding), bottleneck (low impact/high risk: secure continuity and qualify backups even though the spend is small), and strategic (high/high: long-term partnership and joint innovation, the suppliers you manage relationships with, not just purchase orders).
A scored dashboard gives you a number to sort by, usually by spend. Kraljic forces a quadrant, and a quadrant implies a specific negotiating posture regardless of dollar size. A bottleneck item (low spend, high risk) gets treated with the same seriousness as a strategic item, which most spend-ranked tools miss because they optimize for the wrong axis.
TCO = Acquisition + Operating + Maintenance + End-of-Life costs, minus Residual Value. For strategic and bottleneck items especially, acquisition price is often the smallest piece of the real cost. A cheaper strategic supplier with worse quality or longer lead times can cost more once the downstream operating and maintenance delta is priced in. Bring the TCO number, not the unit price, when a strategic-quadrant negotiation reaches finance.
So what
Plot your top 20 spend categories on the two axes this week. Most procurement teams have never done this for anything below their top 5 suppliers, which is exactly where bottleneck-quadrant risk hides unnoticed.
Sources
00:00Lean's instinct is to minimize inventory everywhere. Theory of Constraints' instinct is to protect exactly one point in the system, the constraint, with a deliberate buffer, and let inventory run lean everywhere else. Confuse the two and you starve your own bottleneck.
Both schools want less waste and faster flow, and both are right most of the time, which is why the disagreement between them is worth understanding precisely. One treats inventory as uniformly bad; the other treats it as a targeted tool.
The Toyota Production System's core instinct is pull-based kanban replenishment, minimal work-in-process, and eliminating muda (waste), which treats inventory itself as the enemy across the whole system. It's an extremely effective default, and it's the reason most manufacturing operations run leaner today than they did thirty years ago.
Goldratt's Five Focusing Steps (identify the constraint, exploit it, subordinate everything else to it, elevate it, then repeat without inertia) start from a different premise: a system's total output is capped by its single slowest point, so protecting that one point matters more than minimizing inventory uniformly. Drum-Buffer-Rope operationalizes it. The constraint (drum) sets the pace for the whole system, a deliberate time buffer sits in front of it so upstream variability never starves it, and a rope paces material release to what the constraint can absorb. Non-constraint inventory can run lean while the constraint itself is deliberately protected.
The Indian ductile/grey-iron foundry ran on-time-in-full delivery below 60% and carried roughly 3.5 months of WIP and finished-goods inventory before applying TOC-guided pull replenishment (with consultancy Strategy & Systems), including a 5-color shop-floor priority system and a Runners/Repeaters/Strangers SKU classification. Within months: OTIF rose to 85 to 92%, manufacturing lead times fell 50%, and WIP inventory fell 50%. The WIP was cut where TOC says to cut it, not uniformly across the plant.
So what
Before your next inventory-reduction initiative, identify your actual constraint first. If the initiative cuts stock in front of it, you're about to manufacture a stockout, not savings.
Sources
00:00Gartner defines a digital supply chain twin as a live, continuously updated representation of the physical supply chain used to make decisions, not a one-time model you ran once and filed away. The test is whether data flows both ways, continuously.
Every vendor in supply chain software calls their dashboard a “digital twin” now. The formal technical bar is narrower and checkable. Apply it to your own stack before the next RFP, not after you've signed it.
A traditional simulation ingests historical or hypothetical data, runs a what-if scenario, and its job is finished once that analysis is delivered — it doesn't automatically know if the real world has changed since. A digital twin is continuously fed live data (IoT sensors, ERP, transportation-management systems) and mirrors the physical system's current state in real time, persisting and evolving across the system's entire operational life — sometimes writing decisions back to the physical system, not just reporting on it.
One: does the model update automatically from live data, or does someone have to re-run it manually? Two: can it write a recommendation or control signal back into the physical system, or does a human have to act on its output every single time? Three: does it persist across the system's operational life, or does its job end once this quarter's analysis is delivered? A “digital twin” that fails all three questions is a simulation with a better name.
Unilever, with Accenture, is deploying AI-enabled digital twins across its manufacturing network. The Raeford, North Carolina plant's twin has cut waste 20%, lifted capacity 10%, and predicts 95% of process-flow restrictions in deodorant-stick manufacturing, and more than 40 additional twins are planned across the network over the next 18 months. Siemens' Supply Chain Suite built a genuine network-level twin with BSH Home Appliances Group to test warehouse-network configurations before committing capital to physical changes. DHL's Smart Warehouse combines IoT sensors with real-time data for continuous, largely autonomous decisioning. All three share the live, bidirectional trait a static simulation lacks.
So what
Before your next “digital twin” RFP, run the three-question test on the tool you already have. Plenty of what gets called a digital twin in a vendor deck is a simulation that never got renamed.
Sources
03after hours / the bench
Public code, written after hours.
Supply-chain planner: 14 years across SAP IBP, o9, Kinaxis and S&OP. After hours I build the tools I wish I had, in the open.
Follow on GitHubgithub — now building
this site's git, day by day
LaviSahu / README.md
Every planning repo runs on a bare Python install. Every number is computed, not asserted.
Counted from this site’s git. Public on GitHub so far: 11.
03 / 07
8 repos.
Working code, not a slide.
Pick a card to open it.
Supply chain resilience control tower — risk radar, what-if simulation (time-to-recover / time-to-survive), and mitigation ranking. No dependencies to install; the dashboard is one self-contained HTML file.
Python (stdlib only) — self-contained HTML dashboard
# risk_score = likelihood(1-5) * impact(1-5), range 1-25.
TIER_THRESHOLDS: list[tuple[int, RiskTier]] = [
(20, RiskTier.CRITICAL),
(12, RiskTier.HIGH),
(6, RiskTier.MEDIUM),
(1, RiskTier.LOW),
]
def likelihood_score(event: Event, classification: Classification) -> int:
"""1-5, from event confidence (0-1) plus a source-reliability adjustment."""
base = event.confidence * 5
adjustment = SOURCE_RELIABILITY_ADJUSTMENT.get(classification.source_category, 0)
return _clamp(base + adjustment, 1, 5)Clone git clone https://github.com/LaviSahu/resilience-radar.git
An S&OP / IBP decision cockpit: base vs. upside vs. constrained demand-supply-finance reconciliation, with rough-cut capacity planning on synthetic data.
JavaScript + Python, zero dependencies
def effective_capacity_hours(scenario: ScenarioId, resource: Resource, load_hours: float) -> float:
"""
Hours actually available to allocate this month, per scenario.
BASE / CONSTRAINED: installed capacity, unchanged — no investment.
UPSIDE: installed capacity, topped up to exactly match load whenever
load would otherwise exceed it — "add just enough capacity to clear
the gap RCCP flagged," never more, never less.
"""
if scenario == ScenarioId.UPSIDE:
return max(resource.monthly_available_hours, load_hours)
return resource.monthly_available_hoursClone git clone https://github.com/LaviSahu/sop-integrated-planning.git
A demand-planning diagnostic toolkit: demand segmentation (ADI/CV²), a forecast-accuracy scorecard, and Forecast Value Added, run on synthetic FMCG data.
Python (stdlib only), zero dependencies
def average_inter_demand_interval(records: list[WeekRecord]) -> float:
"""ADI = total periods / number of periods with nonzero demand.
A SKU with demand every single period has ADI == 1.0 (the floor)."""
n_periods = len(records)
n_nonzero = sum(1 for r in records if r.actual > 0)
if n_nonzero == 0:
return float("inf")
return n_periods / n_nonzero
# Canonical Syntetos-Boylan-Croston (2005) cutoffs, dataset-agnostic.
ADI_CUTOFF = 1.32
CV2_CUTOFF = 0.49Clone git clone https://github.com/LaviSahu/demand-planning-diagnostics.git
Offline, Wispr Flow-style voice dictation for Windows: hold a key, speak, release, and a local Whisper model transcribes into whatever app has focus. Audio never leaves the machine.
Python + a local Whisper model
Clone git clone https://github.com/LaviSahu/localwispr-restored.git
A complete personal operating system for Claude Code — global config, skills, subagents, slash commands, and hooks — extracted from a real daily-driver setup, not a starter template.
Config + skills/subagents/hooks (Markdown, shell)
Clone git clone https://github.com/LaviSahu/claude-code-os.git
A reusable design-system library: 25 standalone style systems, each specified in the same 12-field pattern. This is the design-system source this entire site redesign draws from — including apidocs, this page’s own look.
CSS — 25 style systems, one shared token contract
Clone git clone https://github.com/LaviSahu/design-library.git
A controlled regression testing whether delegating edits to a local model actually saves Claude API quota. Result: no — across every task archetype tested, the local-orchestrated arm cost more (+37% on average) despite passing every gate.
Python, run on an Apple M5 Max
Clone git clone https://github.com/LaviSahu/m5-model-benchmarks.git
A Markdown-to-five-theme HTML report generator: one content file, one command, five offline-rendering styled report themes. Extracted out of localwispr-restored.
Python, stdlib tomllib parser, zero third-party deps
class Editorial(Theme):
slug = "editorial"
name = "Editorial"
number = 1
stylesheet = "theme-editorial.css"
blurb = ("Long-form narrative on warm paper, old-style serif, oxblood "
"accent. Stripe Press / MIT Technology Review.")
good_for = ("Essays and post-mortems that are read start to finish. "
"Strongest when the argument carries the page and there is "
"more prose than data.")
options = {"rail": False, "contents": True}Clone git clone https://github.com/LaviSahu/reportkit.git
04build log / this site's own git
Every day this site changed, lit.
no. 010 — build log
1 pixel = 1 day
2026-03-151184 commits, day by day
04 / 07
Dated.
Days only. No commit messages.
05parts / every inner page
The parts every inner page shares
no. 011 — house parts
live
05 / 07
Try the keys.
⌘/Ctrl + ← → moves.
F flips the card.
06ledger / calibration
What was checked, and how.
no. 012 — verification ledger
read as a calibration sheet
| item | checked by |
|---|---|
| Every animation on the rebuilt pages | Seen by human eyes |
| The merge-conflict resolutions of 2026-09-19 | Seen by human eyes |
| Each repo description (2 of 8 carry verbatim code excerpts) | Read, not run |
| Whether anyone has ever used these repos | Nobody has checked |
06 / 07
Checked.
The third column is the honest one. It empties only when the gap does — not before.
07on paper / the datasheet
The whole lab on one sheet.
no. 013 — datasheet
one page
Bullwhip · front
One of seven planning ideas on the shelf.
Small swings in demand grow larger at every step upstream.
Forrester, 1961 · named by Lee, Padmanabhan & Whang, 1997
01 / 07