diamond hunt: godot-0009/0010 + meson-0002 + typeorm-0004/0005 + ts-0003; count 629→635
New diamond recursion defects (O(2^D) → O(N)): - godot-0009: Font::_is_cyclic no visited set — CJK fallback diamond, 2648x at F=4,D=8 - godot-0010: Font::_update_rids_fb no visited set — duplicate RIDs + O(N^2) hot path - meson-0002: get_internal_static_libraries_recurse link_whole guard missing — 132x at D=10 - typescript-0003: hasBaseType inner check() no visited set — 1024x at D=10; hot on instanceof New O(N²) defects: - typeorm-0004: SubjectTopologicalSorter Array.indexOf dedup — 200x at N=400 - typeorm-0005: DepGraph.createDFS result.indexOf + addDependency edge dedup — 300x at N=600 CLEAN confirmed (diamond recursion sweep): bazel, cargo, cmake, composer, dgl, diesel, doctrine-orm, efcore, helm, mybatis, networkx-deeper, ninja, npm-arborist, peewee, pip, rubygems, seaorm, sqlalchemy, swift UNDF: 571→578 assigned; MOAD count: 629→635
This commit is contained in:
parent
ebfcdd3db5
commit
3986d8dc50
46 changed files with 2339 additions and 1 deletions
17
defects/seaorm/patch/seaorm-diamond-recursion-CLEAN.md
Normal file
17
defects/seaorm/patch/seaorm-diamond-recursion-CLEAN.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# sea-orm diamond recursion scan — CLEAN
|
||||
|
||||
Scanned: 2026-03-29
|
||||
Scope: diamond recursion / CWE-407 in ORM dependency graph traversal
|
||||
|
||||
## Files checked
|
||||
|
||||
- `src/schema/topology.rs` — vendored from `gifnksm/topological-sort-rs`;
|
||||
uses Kahn's algorithm with `HashMap<T, Dependency<T>>` where `Dependency` holds
|
||||
`num_prec: usize` (predecessor count) and `succ: HashSet<T>`. Both the topology
|
||||
queue and the adjacency set use O(1) hash operations throughout.
|
||||
`pop_all()` filters by `num_prec == 0` in O(V) per pass. Clean.
|
||||
|
||||
## Verdict
|
||||
|
||||
CLEAN. Topological sort is Kahn's algorithm with HashSet adjacency. No diamond
|
||||
recursion and no Array linear scan in the critical path.
|
||||
Loading…
Add table
Add a link
Reference in a new issue