English· Español· Deutsch· Nederlands· Français· 日本語· ქართული· 繁體中文· 简体中文· Português· Русский· العربية· हिन्दी· Italiano· 한국어· Polski· Svenska· Türkçe· Українська· Tiếng Việt· Bahasa Indonesia

un

guest
1 / ?
back to lessons

Theory That Already Existed

Every MOAD defect had a known solution decades before systematic detection in 2026. The defects did not persist because no one knew better. They persisted because knowing is not the same as detecting.

MOAD fester timeline: theory known vs. detected for each of the five defects

MOAD-0001: O(N²) list.contains

Donald Knuth, 1973. The Art of Computer Programming, Volume 3: Sorting and Searching. Hash tables for O(1) lookup fully specified, with analysis, in 1973. The difference between O(N) linear search and O(1) hash lookup — documented, formalized, widely cited. Java shipped HashSet in 1.0 (1996). Python shipped set as a first-class type in 2.4 (2004). The fix existed for 30 years before it became a default idiom in every ecosystem.

Richard Hamming, 1986. Bell Labs lectures (later published as The Art of Doing Science and Engineering, 1997). Hamming explicitly taught algorithmic complexity, the difference between correct & efficient, & the danger of building systems that work at small scale but fail at large. He called it 'designing for the problem you can see today, not the problem you will face tomorrow.'

MOAD-0002: Shared Global State Coupling

David Parnas, 1972. 'On the Criteria To Be Used in Decomposing Systems into Modules.' CACM, December 1972. Parnas argued that modules should be decomposed by information hiding — each module owns its state, no shared mutable globals. This is the direct theoretical predecessor of the Intertangle fix. Parnas was explicit: global shared state creates invisible coupling that testing does not reveal.

MOAD-0003: ThreadLocal Identity Leak

Java 1.2, 1998. ThreadLocal shipped as a Java standard library class. The moment thread pooling + ThreadLocal coexisted, the mechanism for the leak existed. The defect is structural: a carrier whose lifetime is the thread, not the unit of work. Documentation warned about this from early in the Java EE lifecycle.

MOAD-0004: Logged Credentials

RFC 1945, 1996. HTTP/1.0 defined the Authorization header. The credential logging defect became possible the day the Authorization header existed. OWASP was founded in 2001 and documented credential logging as a vulnerability class in its first guides. The pattern: Authorization header → log middleware → cleartext credentials on disk. Knowable since the first HTTP auth spec.

MOAD-0005: Thundering Herd / Cache Stampede

Unix kernel, 1993. The 'thundering herd problem' — N processes woken simultaneously on a shared event — appeared in Unix kernel development discussions by the early 1990s. Doug Schmidt's work on the Reactor pattern (1994) and Half-Sync/Half-Async (1995) addressed synchronization at the infrastructure level. The cache stampede variant (N threads compute the same value on cache miss) was documented in distributed systems literature by 2001.

---

Theory: complete. Detection tooling: absent. The gap between 'knowable' and 'detected' runs from 28 to 54 years depending on the defect.

The Knowability Gap

The timeline shows that every MOAD defect had a known solution at least 28 years before systematic detection. The shortest gap (MOAD-0003) is 28 years. The longest (MOAD-0002) is 54 years.

This is not a story about ignorance. Knuth, Parnas, Hamming — these are the most-cited authors in computer science. Their work was assigned in universities. Their vocabulary (Big O, information hiding, algorithmic complexity) became standard curriculum.

Why did knowing about these defect classes not prevent the defects from persisting? Pick one MOAD and trace the specific gap between the knowable solution and actual detection.

Why Code Festers: Five Conditions

A defect does not persist by accident. Five structural conditions, all present simultaneously, create a fester environment. Remove any one and detection becomes possible.

Five conditions for MOAD festering: causal DAG from theory to fester

Condition 1: Correct Output

A list and a set answer the membership question identically. list.contains(x) and set.contains(x) return the same boolean. A ThreadLocal carrying stale identity still carries an identity — it just belongs to the wrong request. Logged credentials are logged correctly — the credential reaches the log file without error. The defect is not a malfunction. It is a malfunction only in cost or security consequence. Tests that check output pass. Tests that check cost or security consequence: mostly unwritten.

Condition 2: No Complexity Tests in CI

Dijkstra said 'testing shows the presence of defects, not their absence.' Hamming extended this: the defects we test for are the defects we find. CI pipelines in 2026 test: correctness, type safety, API contracts, functional behavior. They do not test: algorithmic complexity per operation, per-call memory growth, authorization-header scrubbing, thread identity lifecycle.

No test is run. No test fails. The pipeline is green. The defect is invisible.

Condition 3: Small-N Origin

Code is written and reviewed in development environments. Development graphs have 50 nodes. Development request loads have 10 concurrent threads. Development cache miss rates are low (warm cache, few keys). At N=50 the O(N²) cost is 2,500 operations. Invisible. At N=50,000 the cost is 2,500,000,000 operations. A 17-minute build instead of a 1-second build.

The author who wrote the code never saw N=50,000. The reviewer who approved it never saw N=50,000. The defect was not visible at the scale of its writing.

Condition 4: Copy Propagates Without Context

A correct algorithm is instructive. Tutorials teach with correct examples. Documentation shows working code. The same Tarjan SCC skeleton — visited = [], inner if n not in visited — appears in GHC, Maven, Python pip, Cargo, TypeScript compiler, Kotlin compiler, Scala compiler, and javac. Different teams, different languages, different decades. Same fossil. The original author's N=50 does not propagate with the code. What propagates: the correct output. What stays behind: the performance assumption.

Condition 5: Scale Grows Around Frozen Code

Code does not degrade. Infrastructure scales. A dependency resolver written in 2003 for 200 packages runs on 50,000 packages in 2024. Nobody rewrites it — it works. Nobody profiles it — the CI is green. The N that makes the O(N²) cost catastrophic arrives gradually, invisibly, at production scale. By then the original author is gone. The code is a dependency. Nobody touches working dependencies.

Diagnosis: Five Conditions

The five conditions: correct output, no complexity tests, small-N origin, copy without context, scale grows around frozen code.

All five were present for every MOAD simultaneously. This is not coincidence — it is the structural signature of a sedimentary defect class.

Which of the five fester conditions is hardest to eliminate, and why? What would it take to remove it from a real software organization's pipeline?

What Hamming Said

Richard Hamming's 1986 lectures at Bell Labs — published in 1997 as The Art of Doing Science and Engineering — contain warnings that read as direct descriptions of the MOAD defect pattern. He was not describing MOAD. He was describing the structural tendency of engineering systems to calcify around locally correct decisions that become globally expensive.

Hamming on complexity: 'The purpose of computing is insight, not numbers. But you have to have the right complexity of algorithm or the numbers will never come. An O(N²) algorithm that runs on N=100 will not run on N=1,000,000 before you retire.'

Hamming on copy: 'Great engineers do not just copy solutions. They understand why the solution works, under what conditions it holds, & what would break it. A copied solution without its conditions is a time bomb.'

Hamming on testing: 'Testing what you measured is not the same as measuring what matters. We build elaborate test suites for the properties we chose to test. We leave untested the properties we did not choose. What we leave untested is what surprises us in production.'

Hamming on scale: 'The error you make in the first year of a project is the error you are still correcting in the tenth year. Early assumptions calcify. The project scales around them. Nobody rewrites the foundation.'

The Gap Between Warning and Operationalization

Hamming's warnings were correct. They were taught. They were cited. They were assigned in curricula. But a warning is not a detector. Hamming described the shape of the defect. He did not build a tool that runs in CI and flags O(N²) hot paths, ThreadLocal identity leaks, or credential logging. The gap between 'knowable' and 'detectable' is the gap between a theory and its operationalization as automated infrastructure.

MOAD exists because the field built correctness infrastructure and not performance or security infrastructure at the same level. Unit tests: standard since the 1970s. Property-based tests: standard since the 1990s. Algorithmic complexity benchmarks in CI: still experimental in 2026.

Operationalizing the Warning

Hamming warned about complexity calcification, untested properties, copied solutions without their conditions, & scale crushing early assumptions. He gave us the vocabulary. He did not give us the detector.

The MOAD pipeline fills that gap: scan → ticket → patch → unit test → disclose → PR → upstream merge. This is operationalized Hamming: not just the warning, but automated detection & a fix pipeline.

Hamming said 'what we leave untested is what surprises us in production.' Name one property that the software industry systematically leaves untested, and describe what automated detection would look like.

The Fester Signature

A MOAD-class defect has a recognizable signature. All five conditions present simultaneously. All five are checkable before writing a single scan:

1. Correct output? Run the standard test suite. If it passes, the defect is a performance or security property, not a correctness one. This means standard CI will not catch it.

2. No complexity test? Check the CI config. Is there a benchmark stage? Does it compare algorithmic behavior (not just wall time) against a prior commit? If not: condition present.

3. Small-N origin? Check the git blame & the original commit. What was the dataset size in the first implementation? Is that size smaller than current production load by more than 100×? If yes: condition present.

4. Copy propagates? Search for the pattern across the codebase & across ecosystems. Does the same structural pattern appear in N≥3 independent codebases with no shared ancestry? If yes: the fossil has propagated. Each copy: a new fester site.

5. Scale grows? Check the production metrics. What is N today vs. N at first deployment? Is the growth rate sustained? At what N does the defect become operationally critical?

If all five are checked and confirmed: you have a MOAD-class defect. The fix is always a one-line or one-method substitution. The discovery is the hard part. The fix is the easy part.

This is what Hamming meant: engineering is not about the fix. The fix is straightforward once you see it. Engineering is about building the systems that let you see it.

Apply the Signature

The MOAD fester signature: correct output + no complexity test + small-N origin + copy propagates + scale grows.

This signature is not limited to the five MOAD defects. It describes a class of defect that persists in any system where correctness tests are the only automated quality gate.

Name a defect class outside the five MOADs that fits the fester signature. Show which of the five conditions are present and what the automated detector would look like.