[Discussion] Extend streaming-first to the transform/generator layer (strict reading)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 12/100
Hướng nghiên cứu
This is a proposal, not a task: the status line says not to start until scope is agreed. Read the audit table, then the functions it cites: graph_dir_to_g_text in to_g_text.py:140, iter_edges_from_rdf in rdf.py:122, and materialize in cnf_template.py:246. The only open question for a newcomer is the decision in the final section, so the useful contribution is discussion on that thread, not code.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Status: PROPOSAL FOR DISCUSSION — not to be started until scope is agreed.
Context
The pragmatic reading (documented in the companion doc task) treats the in-memory MultiDiGraph transform/generator layer as a legitimate "NetworkX boundary." This issue captures the strict-reading audit — where that layer could be made streaming — so the team can decide whether to extend the principle. It is the detailed analysis from the architecture investigation, not an immediate implementation task.
Full audit (memory behavior of every graph-handling function)
Already streaming (aligned): all iter_edges_from_* (mtx, txt) and *_from_edges writers (mtx, txt, rdf, g); convert_graph; graph_dir (streaming download + sha256); reachable_pairs (CSV). dataset/ never builds a MultiDiGraph.
Silent breakers of the streaming ideal
| Function | Location | Problem |
|---|---|---|
validate_archive |
check_archive_structure.py:603 |
builds a full MultiDiGraph for a parse check — being fixed in #189 |
graph_dir_to_g_text |
to_g_text.py:140 |
lines = list(_g_lines(...)); "\n".join(lines) collects an O(E) string although _g_lines is already a generator; returning an iterator / writing to a file would make it O(1) |
iter_edges_from_rdf |
rdf.py:122 |
returns an iterator but materializes the whole RDF store — rdflib has no streaming Turtle parser (unavoidable, documented) |
Trivially streamable (per-edge, no global state)
add_reverse_edges— each edge → forward + reverse.filter_edges— per-edge predicate (makelabelsa set for O(1) lookup).change_edges— per-edge dict lookup.get_labels_frequency/get_sorted_labels— a streaming counter; output is O(#distinct labels).
Label-set-only (could take a narrower input than the full graph)
materialize/materialize_grammar—cnf_template.py:246reads only{data["label"] for … in graph.edges(...)}; works unchanged over an edge stream.java_points_to_grammar_from_graph—java_points_to_grammar.py:158collects only load/store field names; node ids unused.
Fundamentally need global state (strictly necessary to materialize / two-phase)
nodes_to_integers— global node→index map over all nodes.generate_multiple_source/generate_multiple_source_percent— global node count + uniform sampling (a reservoir-sampling rewrite could make it one-pass).- Generators
labeled_barabasi_albert_graph,labeled_scale_free_graph— global degree state.
By contract (return a graph object; streaming optional)
graph_from_*loaders; deterministic generatorslabeled_binomial_graph,fast_labeled_binomial_graph,labeled_cycle_graph,labeled_two_cycles_graph.
Decision needed
- Keep the pragmatic boundary as-is (transforms/generators stay in-memory), or extend streaming-first to the trivially-streamable + label-set-only functions (a follow-up refactor)?
- Independently of the principle debate: should
graph_dir_to_g_textbe fixed now? It is a cheap O(E)→O(1) win (its inner_g_linesis already a generator) and does not depend on the boundary decision.
- Ngôn ngữ chính
- Python
- Star
- 13
- Fork
- 16
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của FormalLanguageConstrainedPathQuerying/FLPQ_Data
-
documentation task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
task
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
FormalLanguageConstrainedPathQuerying/FLPQ_Data#185 · 1 bình luận ·
-
Page title is CFPQ_DataĐang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
-
task
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
FormalLanguageConstrainedPathQuerying/FLPQ_Data#192 · 1 bình luận ·
-
task
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 45/100
FormalLanguageConstrainedPathQuerying/FLPQ_Data#189 · 1 bình luận ·
Tất cả issue của FormalLanguageConstrainedPathQuerying/FLPQ_Data
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
Library sweep logs an ERROR at start for the valkey instrumentor when valkey-py is not installedĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
JoahanMorales/upiixia-agentic-kit#99 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
NatLabRockies/openstudio-mcp#286 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100