[Bug]: graphify query prints a different answer on each run (BFS walks a set in hash order)
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Leggi _bfs in graphify/serve.py e segui come il suo ordine di visita influisce sull’output di graphify query e sul budget di token. Riproduci il problema con il ciclo PYTHONHASHSEED dell’issue, poi controlla la stessa query con seed diversi; il lavoro è completato quando l’output e gli archi mantenuti sono stabili tra le esecuzioni. Nell’issue non è indicato alcun file di test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Pre-flight checks
- I have checked the Troubleshooting section in the README
What happened?
graphify query prints a different answer on every run, on the same graph. _bfs in graphify/serve.py walks each level as a set of node ids (frontier = set(start_nodes), for n in frontier:), so the EDGE lines come out in string-hash order, which Python randomizes per process. query is not in _HASHSEED_PINNED_COMMANDS, and the MCP server runs the same traversal in a long-running process, so nothing pins it. The order also decides which edges survive the token budget.
Distinct outputs over 10 runs (PYTHONHASHSEED 1 to 10):
| repo | query | budget | distinct outputs |
|---|---|---|---|
| flask | how does url_for work | 50k | 10 |
| click | how does echo work | 50k | 10 |
| django | how does slugify work | default | 10 |
| django | how does the queryset build sql | 50k | 10 |
On a FastAPI template repo, graphify query 'how does cn() work' run 6 times gave 5 different outputs.
Steps to reproduce
cd flask && graphify update .
for s in 1 2 3; do PYTHONHASHSEED=$s graphify query "how does url_for work" --budget 50000 | md5sum; done
Three different hashes.
Error output or graph output
Example, first 3 contains EDGE lines on a tiny graph (one seed, 60 neighbours), seeds 1 / 2 / 3:
helper_7, helper_17, helper_6 | helper_1, helper_13, helper_17 | helper_18, helper_17, helper_8
Graphify version
0.9.105 (v8 at 5eedffa8)
Operating System
Windows (also seen on Linux)
Python Version
3.12
Installation Method
uv tool install (recommended)
Additional context
_dfs uses a list stack and is already stable. Related but different: #2817 and #1667 (cluster order), #3743 (hash seed pinned for other commands).
- Lingua principale
- Python
- Stelle
- 124k
- Fork
- 11.9k
- Merge medio
- 2h 35m
- PR unite (30g)
- 6
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Graphify-Labs/graphify
-
[Bug]: Python mod.Box[T] annotation gets a false generic_arg edge that replaces the parameter_type one ('is' on tree-sitter nodes)Forse già presa @rohit-jsfreaky l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Graphify-Labs/graphify#5110 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Graphify-Labs/graphify#5006 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
extract --out <dir>: semantic cache never saved, docs missing from manifest (relative source_file resolved against --out)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Graphify-Labs/graphify#4831 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
hooks: last-resort `python3` probe launches the Microsoft Store redirector on Windows (visible console flash, exit 9009)Forse già presa @Deepjyoti-Sarmah l’ha presa 21 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Graphify-Labs/graphify#4563 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
GRAPHIFY_DISABLE_THINKING is ignored by the claude backend, so thinking eats max_tokens and extraction truncatesForse già presa @bercedev l’ha presa 22 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
Graphify-Labs/graphify#4546 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di Graphify-Labs/graphify
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
volcengine/OpenViking#7347 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
duolicious/duolicious#1943 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
fedora-infra/anitya#2166 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NVIDIA/auto-ontology#486 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
NVIDIA/SkillEvaluator#446 ·
I maintainer di solito rispondono entro 2 giorni