Question - Is the test case correct?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
Research direction
Start with the TestGraph_AddSearch test and inspect the implementations of Graph.Search and Analyzer.Topography that determine the expected ordering and layer counts. Compare the test's expected nearest nodes with the search behavior, then document whether the test is correct and what the expected result should be.
Written by the indexing model from the issue text.
Description
Hey Team,
Is the following test case correct?
func TestGraph_AddSearch(t *testing.T) {
t.Parallel()
g := newTestGraph[int]()
for i := 0; i < 128; i++ {
g.Add(
Node[int]{
Key: i,
Value: Vector{float32(i)},
},
)
}
al := Analyzer[int]{Graph: g}
// Layers should be approximately log2(128) = 7
// Look for an approximate doubling of the number of nodes in each layer.
require.Equal(t, []int{
128,
67,
28,
12,
6,
2,
1,
1,
}, al.Topography())
nearest := g.Search(
[]float32{64.5},
4,
)
require.Len(t, nearest, 4)
require.EqualValues(
t,
[]Node[int]{
{64, Vector{64}},
{65, Vector{65}},
{62, Vector{62}},
{63, Vector{63}},
},
nearest,
)
}
I think 66 is closer to 64.5 as compared to 62. Or am I missing something here?
- Dominant language
- Go
- Stars
- 240
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coder/hnsw
-
Panic will appear when running this demo.Possibly taken @sidsri14 claimed this 91 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 42/100
-
question
Difficulty 5/5 Over a week Newbie friendliness 20/100
Similar issues
-
[flaky test] TestValidatorCommitterDropsEmptyStatusBatch: submits to the mock VC before its stream is registeredPossibly taken @liran-funaro claimed this today. Opencoordinator flaky-test race-condition testing
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
hyperledger/fabric-x-committer#876 ·
Maintainers usually reply within 1 day
-
kind/features
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
TencentBlueKing/bk-nodemgr#3804 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudnative-pg/plugin-barman-cloud#1187 ·
Maintainers usually reply within 1 day
-
[deliverclient] Remove the unused common/deliverclient packagePossibly taken @liran-funaro claimed this today. Opencode-hygiene
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
hyperledger/fabric-x-common#236 ·
Maintainers usually reply within 1 day
-
consensus feature I2 S4 U2
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day