Skip to content

refactor(suggest): take the edit-distance minimum from the builtin min - #1487

Merged
HuiJun merged 1 commit into
developfrom
refactor/suggest-builtin-min
Oct 25, 2026
Merged

HuiJun merged 1 commit into
developfrom
refactor/suggest-builtin-min

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

What and why

suggest.EditDistance took the three-way minimum of its Levenshtein cell from a local min3(a, b, c int) helper. The module is on Go 1.25, where the builtin min accepts any number of ordered operands, so the one caller now reads cur[j] = min(cur[j-1]+1, prev[j]+1, prev[j-1]+cost) and min3 is deleted. For int operands the two are identical; no distance changes.

How it was verified

tests/suggest TestEditDistance already pins the distances the suggestions rank on (including the transposition case) and passes unchanged.

go build ./...        clean
go vet ./...          clean
gofmt -l .            (nothing)
go test ./...         all ok except tests/codegen, which hit go test's 10 m default
                      package timeout under the parallel full-suite load
                      (TestCompiledStepBudgetMatchesInterpreter in a `go build` wait);
                      rerun alone: ok  tests/codegen  309.172s
python3 scripts/changelog.py check   ok

Checklist

  • make test and make lint pass locally
  • Tests added or updated for the change (existing TestEditDistance covers the behaviour; nothing new needed)
  • Documentation extended where it already covers the surface (none covers min3)
  • Changelog entry added as changes/unreleased/suggest-builtin-min.changed.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (no count moved)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/c6693d7624634e459fb1c7aac47762ec
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/c6693d7624634e459fb1c7aac47762ec?variant=devin
Requested by: @HuiJun

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review October 25, 2026 03:39

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@HuiJun
HuiJun merged commit be94c53 into develop Oct 25, 2026
53 checks passed
@HuiJun
HuiJun deleted the refactor/suggest-builtin-min branch October 25, 2026 07:30
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.

1 participant