Skip to content

Fix all 82 bugs from BUGS.md audit - #85

Merged
ilyakooo0 merged 56 commits into
masterfrom
fix/bug-audit-all-82-bugs
Jul 13, 2026
Merged

Fix all 82 bugs from BUGS.md audit#85
ilyakooo0 merged 56 commits into
masterfrom
fix/bug-audit-all-82-bugs

Conversation

@ilyakooo0

Copy link
Copy Markdown
Owner

Summary

Went through every bug in BUGS.md (82 total, 16 previously marked fixed) and verified each one against the current codebase. All 82 bugs are now marked as [x]0 remaining.

Bugs requiring actual code fixes (4):

  • B3 — User functions shadowing stdlib names no longer silently discarded by codegen (codegen.rs)
  • B19 — Refinement validation added for migrate … using via knot_source_migrate_preview (codegen.rs)
  • B29-B31 — Stratification detects diff wrappers, self-recursive views, non-monotone aggregates (stratify.rs)
  • B45value_contains_nonfinite_float made iterative over work stack to avoid stack overflow on deep constructor spines (lib.rs)

Bugs already fixed in code (78):

The majority of bugs had been fixed in prior commits (#59#74) but were never marked as [x] in BUGS.md. Each was verified against the current codebase and marked accordingly.

Verification

  • cargo build
  • cargo test1,685 tests passed, 0 failed
  • 53 commits, one per bug (or small group)

ilyakooo0 added 30 commits July 13, 2026 13:15
The try_infer_fetch function already handles ast::ExprKind::Constructor(_)
by returning None for record_arg (infer.rs:5817), skipping payload unification
for bare nullary route constructors. The response type is resolved from route
metadata regardless. Verified by cargo test -p knot-compiler (all tests pass).
Both infer and codegen now use last-wins in source declaration order for
constructor name resolution. infer.rs:7651-7663 always inserts
fetch_response_headers (even when empty) to prevent stale header chimera.
codegen.rs:1919-1928 populates fetch_route_entries with last-wins insert,
and compile_fetch (codegen.rs:7082) looks up by ctor_name from this map.
Verified by cargo test -p knot-compiler (all tests pass).
Prelude spans are shifted by PRELUDE_SPAN_OFFSET (1 << 40) in base.rs:201-203,
far above any plausible user file size and above desugar::SYNTH_SPAN_BASE
(1 << 31), so prelude monad_info keys can never collide with user-file or
synthesized spans. Verified by cargo test -p knot-compiler (all tests pass).
The race parent (lib.rs:8464-8481) polls with RACE_CANCEL_POLL (50ms timeout)
and checks cancel_requested() between waits. When outer cancellation fires,
it cancels both inner workers (cancel_a.cancel(), cancel_b.cancel()) and
unwinds with Cancelled — exactly like other cancellation checkpoints.
Verified by cargo test -p knot-runtime (all 161 tests pass).
A HandlerDropGuard (lib.rs:17241-17246) wraps the deep-cloned handler tree
across knot_db_open, which can panic via .expect. The guard's Drop calls
deep_drop_value, preventing the leak. Once db_open succeeds, the guard is
forgotten so manual drops retain sole ownership. Mirrors IoDropGuard in
knot_fork_io and the race worker. Verified by cargo test -p knot-runtime.
ilyakooo0 and others added 26 commits July 13, 2026 13:46
@ilyakooo0
ilyakooo0 merged commit 2e5e0a5 into master Jul 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants