instance_id
stringlengths
10
65
repo
stringlengths
5
59
pr_number
int64
1
313k
task_type
stringclasses
1 value
base_commit
stringlengths
40
40
review_commit
stringlengths
40
40
title
stringlengths
2
282
body
stringlengths
7
3k
patch
stringlengths
202
204k
n_defects
int64
1
72
n_supported
int64
1
65
n_major
int64
0
32
defects
stringlengths
140
18.8k
certifier_count
int64
stanfordnlp__dspy__8718
stanfordnlp/dspy
8,718
defect
361473cb5fe29c91d0ee7b4fddc2967115f4f80f
49d189abbc7bdf0ab3a12c99a7e894ef2dee5180
Fallback to memory cache when disk is not available
Resolve #8717
diff --git a/dspy/clients/__init__.py b/dspy/clients/__init__.py index 15917d34fa..fda1e9e354 100644 --- a/dspy/clients/__init__.py +++ b/dspy/clients/__init__.py @@ -63,9 +63,7 @@ def configure_cache( else: litellm.cache = None - import dspy - - dspy.cache = Cache( + DSPY_CACHE = Cache( ...
2
1
0
[{"id": "G0", "claim": "Catching a broad `Exception` is too generic; the fallback should catch more specific exceptions like `PermissionError`, `OSError`, or `FileNotFoundError` that are likely when disk cache initialization fails.", "category": "maintainability", "verdict": "uncertain", "priority": "P2", "scope": "int...
null
stanfordnlp__dspy__8721
stanfordnlp/dspy
8,721
defect
361473cb5fe29c91d0ee7b4fddc2967115f4f80f
60c8ff0b1de3dd29e2e93e1e70c2e6248340b8f8
Add Anthropic Citation API support
Add support for Anthropic Citation API through new types (dspy.experimental.Document, dspy.experimental.Citation). The design strategy is the same as dspy.Tool & dspy.ToolCalls. Example ```python import dspy from dspy.signatures import Signature class AnswerWithSources(Signature): '''Answer questions usin...
diff --git a/dspy/__init__.py b/dspy/__init__.py index ea4c75a862..8b21238c2f 100644 --- a/dspy/__init__.py +++ b/dspy/__init__.py @@ -6,7 +6,7 @@ from dspy.evaluate import Evaluate # isort: skip from dspy.clients import * # isort: skip -from dspy.adapters import Adapter, ChatAdapter, JSONAdapter, XMLAdapter, Two...
7
5
2
[{"id": "G0", "claim": "Document.format is annotated to return a list of dicts but actually returns a single dictionary, so the return annotation should be dict[str, Any] to match the actual return value.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim"...
null
stanfordnlp__dspy__8763
stanfordnlp/dspy
8,763
defect
91e7e23bf977dca8cd14bf8090a430527f8077b0
d86ef4dc35d693e554caf939b861738c12e71b15
Add MLFLow <> GEPA support
This PR needs to be merged after the new gepa version is published
diff --git a/dspy/teleprompt/gepa/gepa.py b/dspy/teleprompt/gepa/gepa.py index 14aeac89ea..83af5bafda 100644 --- a/dspy/teleprompt/gepa/gepa.py +++ b/dspy/teleprompt/gepa/gepa.py @@ -288,9 +288,9 @@ def __init__( # Logging log_dir: str = None, track_stats: bool = False, - use_wandb: bo...
7
3
3
[{"id": "G0", "claim": "The gepa dependency should be updated to the newly released 0.0.10 that the pull request's MLflow support requires.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Perhaps the use_mlflow flag is unnecessary because users who c...
null
stanfordnlp__dspy__8765
stanfordnlp/dspy
8,765
defect
91e7e23bf977dca8cd14bf8090a430527f8077b0
a8c6ff5c996a136646bb40196f6f0b241fac2776
[Feature] GEPA: Add custom component selection logic support
## Summary This PR implements custom component selection logic for GEPA as requested in issue #8755. It allows users to provide custom strategies for selecting which components (predictors) to optimize at each iteration, enabling more flexible optimization patterns. ## Key Features - **Custom Component Selecti...
diff --git a/dspy/teleprompt/gepa/gepa.py b/dspy/teleprompt/gepa/gepa.py index 14aeac89ea..64f16772bf 100644 --- a/dspy/teleprompt/gepa/gepa.py +++ b/dspy/teleprompt/gepa/gepa.py @@ -6,6 +6,7 @@ from gepa import GEPAResult from gepa.core.adapter import ProposalFn +from gepa.proposer.reflective_mutation.base import ...
7
5
3
[{"id": "G0", "claim": "The PR should include documentation: one example of using a custom instruction proposer and one example of a custom module selector.", "category": "documentation", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Add the implementation of an \"all\" componen...
null
stanfordnlp__dspy__8775
stanfordnlp/dspy
8,775
defect
a6ee7559b67af0cdd4dd4a5540847d8b2bce909d
aa0a7d6c6db33182d5dc3b39188623021bf499b5
docs: Add comprehensive instruction_proposer documentation and examples for GEPA
## Summary Resolves #8767 - Adds comprehensive documentation and working examples for GEPA's `instruction_proposer` parameter. ## What's Changed ### Documentation Enhancements - **Added complete custom instruction_proposer section** to `docs/docs/api/optimizers/GEPA.md` covering what instruction_pr...
diff --git a/docs/docs/api/optimizers/GEPA.md b/docs/docs/api/optimizers/GEPA.md index 707d974b04..117e1361b9 100644 --- a/docs/docs/api/optimizers/GEPA.md +++ b/docs/docs/api/optimizers/GEPA.md @@ -68,6 +68,318 @@ highest_score_achieved_per_task = new_prog.detailed_results.highest_score_achiev best_outputs = new_prog...
14
5
1
[{"id": "G0", "claim": "The mention of InstructionProposalSignature should link to it.", "category": "documentation", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The docs should highlight that custom instruction proposers are an advanced feature most users shouldn't need.", ...
null
stanfordnlp__dspy__8778
stanfordnlp/dspy
8,778
defect
4ece27f7494e3ae3ac4311034481f9c697edb69a
60cc30c9fd47b12c8e228b47f5404ae91bbaee9b
Allow custom type to be streamed and use native response
This PR increases the extensibility of dspy.Type and allows users to define a custom type that can be streamed or use native LM response. This is useful when users want to use provider specific response field such as tool call or citation. Following methods are introduced into dspy.Type - is_streamable: Whether the...
diff --git a/dspy/adapters/base.py b/dspy/adapters/base.py index f714b338bc..690f84af62 100644 --- a/dspy/adapters/base.py +++ b/dspy/adapters/base.py @@ -4,10 +4,9 @@ import json_repair import litellm -from dspy.adapters.types import History +from dspy.adapters.types import History, Type from dspy.adapters.types....
6
5
1
[{"id": "G0", "claim": "The nested condition check in _call_preprocess should be merged into one line with the isinstance/issubclass check above.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The handling of tool_calls should also be moved into...
null
stanfordnlp__dspy__8814
stanfordnlp/dspy
8,814
defect
9c69dedf4bd7171e3229a7163316d0a134f43ead
0a48fcb64e3b695d3fd0829a0b0cdf5f7b5cb5c0
Parse doubly-encoded base type in json.parse
Currently, DSPy custom types can be encoded twice: once in `Type.serialize_model` and once in `format_field_value`, which makes it impossible to parse the value `json.parse`. This PR fixes the behavior by decoding the extracted string twice.
diff --git a/dspy/adapters/types/base_type.py b/dspy/adapters/types/base_type.py index 1a47eb2b4d..0cab64131b 100644 --- a/dspy/adapters/types/base_type.py +++ b/dspy/adapters/types/base_type.py @@ -64,7 +64,7 @@ def extract_custom_type_from_annotation(cls, annotation): def serialize_model(self): formatte...
4
2
0
[{"id": "G0", "claim": "The new _parse_doubly_quoted_json helper wraps json_str in extra quotes assuming it is always a raw string, which could fail with invalid JSON syntax if json_str is already a properly quoted JSON string; the suggestion is to try parsing directly first and fall back to the quoted form.", "categor...
null
stanfordnlp__dspy__8817
stanfordnlp/dspy
8,817
defect
10fb579947307c79754a58e68655ce2122dc4084
b3300408750cacedceef8a2b316727a26fef82ab
Display metric=0 in eval table
Closes #8785
diff --git a/dspy/evaluate/evaluate.py b/dspy/evaluate/evaluate.py index 2da5b6ccf1..e36f50f118 100644 --- a/dspy/evaluate/evaluate.py +++ b/dspy/evaluate/evaluate.py @@ -337,7 +337,7 @@ def stylize_metric_name(df: "pd.DataFrame", metric_name: str) -> "pd.DataFrame": :param metric_name: The name of the metric for ...
1
1
0
[{"id": "G0", "claim": "The lambda in stylize_metric_name is a bit too long and should be made a full function instead.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
stanfordnlp__dspy__8818
stanfordnlp/dspy
8,818
defect
10fb579947307c79754a58e68655ce2122dc4084
6bba980e02f37620030ba95a83f4e6ada1c8ae4f
Add save/load to Embeddings
Closes #8807
diff --git a/dspy/retrievers/embeddings.py b/dspy/retrievers/embeddings.py index 9b9b31be72..15a4dda498 100644 --- a/dspy/retrievers/embeddings.py +++ b/dspy/retrievers/embeddings.py @@ -1,11 +1,11 @@ +import os +import pickle from typing import Any import numpy as np from dspy.utils.unbatchify import Unbatchify...
5
3
0
[{"id": "G0", "claim": "The saved config is JSON-serializable, so consider using JSON instead of pickle for the config file.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Question whether load() needs to reinitialize self.search_fn = Unbatchify(self._ba...
null
stanfordnlp__dspy__8831
stanfordnlp/dspy
8,831
defect
a9ba09d845a3f601b16ead6b3454363565bdc323
019caac3094e896e3ec44fdee943287e85fdd664
Fix the crash when usage tracker is enabled with non-prediction output
Currently, dspy modules whose output is not `dspy.Prediction` fail to execute when the usage tracker is enabled. This PR fixes the crash by skipping the usage tracking for this type of modules. While returning objects other than dspy.Prediciton is not expected, this pattern has been found in several places. Example:...
diff --git a/dspy/primitives/module.py b/dspy/primitives/module.py index 6766a55a5c..bb07e44069 100644 --- a/dspy/primitives/module.py +++ b/dspy/primitives/module.py @@ -83,10 +83,8 @@ def __call__(self, *args, **kwargs) -> Prediction: prediction_in_output = output elif isinstance...
1
1
1
[{"id": "G0", "claim": "The change silences the track_usage feature without user awareness: users with usage tracking enabled will see no usage reported and no error or warning raised, so a warning should be logged (or the old behavior kept with a better error message).", "category": "design", "verdict": "supported", "...
null
stanfordnlp__dspy__8833
stanfordnlp/dspy
8,833
defect
1df5984007b7fd9bb56f3a8fba7a68b5517efb69
839b939f1b1ad29877771b87e741abb1a53bf064
Allow stream listener to work on any type
Previously we limit stream listeners to only work with str field and some prebuilt types. This PR lifts up the constraint, and allow streaming on any types. Here is the gist: - StreamLIstener works the same way as before, i.e., only capture streaming chunks associated with a certain field. - We don't perform additi...
diff --git a/dspy/streaming/streaming_listener.py b/dspy/streaming/streaming_listener.py index e4fc5e1967..2b73cd4c12 100644 --- a/dspy/streaming/streaming_listener.py +++ b/dspy/streaming/streaming_listener.py @@ -3,6 +3,7 @@ from queue import Queue from typing import TYPE_CHECKING, Any +import jiter from litellm...
12
6
0
[{"id": "G0", "claim": "The return annotations of `_json_adapter_handle_stream_chunk` and `_default_handle_stream_chunk` should be `StreamResponse | None` instead of `str`.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The buffering comment should ...
null
stanfordnlp__dspy__8860
stanfordnlp/dspy
8,860
defect
92997073e07e68241677fd32efcc55a2daee30ea
c45b562a7d184b763f0bc19b446f7d3c57bb6810
Fix error handling in dspy parallel
Fixes #8857
diff --git a/dspy/predict/parallel.py b/dspy/predict/parallel.py index 5c183885e4..91f5c1812b 100644 --- a/dspy/predict/parallel.py +++ b/dspy/predict/parallel.py @@ -64,7 +64,15 @@ def process_pair(pair): # Execute the processing function over the execution pairs results = executor.execute(process_pa...
2
1
0
[{"id": "G0", "claim": "The magic string '__dspy_exception__' is duplicated at two places in dspy/utils/parallelizer.py and should be defined once as a module-level constant to avoid repetition and potential typos.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id":...
null
stanfordnlp__dspy__8862
stanfordnlp/dspy
8,862
defect
2f9e9a01a181b4f6f864088be1c8ee984c95e404
62a245e35928b40f8d661de08a5f6a51610ffb41
bug(lm): Avoid unnecessary cache key computation
When both memory and disk cache are disabled, we want to avoid creating a cache key that will not be used. Creating the cache key is expensive for prompts with images in them. Fixes #8856
diff --git a/dspy/clients/cache.py b/dspy/clients/cache.py index 187043538e..9c49353dcd 100644 --- a/dspy/clients/cache.py +++ b/dspy/clients/cache.py @@ -96,19 +96,25 @@ def transform_value(value): return sha256(orjson.dumps(params, option=orjson.OPT_SORT_KEYS)).hexdigest() def get(self, request: dict[...
3
2
0
[{"id": "G0", "claim": "Remove the renaming of self.enable_memory_cache/self.enable_disk_cache into local variables in Cache.get.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "In Cache.put, keep the name enable_memory_cache for the combined fla...
null
stanfordnlp__dspy__8871
stanfordnlp/dspy
8,871
defect
671d733705b85d160fd7e1931eb218098b8990d2
3a568c21ddcb813dec2900686ae031ff0c366c95
fix(JSONAdapter): Add escape logic if json mode but not structured outputs are supported
Adds an extra check to `litellm.supports_response_schema` if structured output mode is supported. Follows guidance from: https://docs.litellm.ai/docs/completion/json_mode#check-model-support Also edits the JSONAdapter and ChatAdapter tests to use the proper model name. See: https://github.com/BerriAI/litellm/b...
diff --git a/dspy/adapters/json_adapter.py b/dspy/adapters/json_adapter.py index 898125f00d..49783cef80 100644 --- a/dspy/adapters/json_adapter.py +++ b/dspy/adapters/json_adapter.py @@ -44,7 +44,14 @@ def __init__(self, callbacks: list[BaseCallback] | None = None, use_native_funct super().__init__(callbacks=c...
3
3
1
[{"id": "G0", "claim": "The two blank lines this pull request adds at the end of `_json_adapter_call_common` in dspy/adapters/json_adapter.py appear unintentional and should be removed.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Remove the n...
null
stanfordnlp__dspy__8881
stanfordnlp/dspy
8,881
defect
00eda956103fc6e56ea6d684361b4f1b2cc130b5
8e7ce4bc37b6ac55378587a07cecc95181b612e6
Fix chunk loss in the long streaming response with native response field
**Issue** There is an issue that some text content chunks are lost when there are more than 10 chunks for a string field, and the native response, such as Anthropic Citation, is used. **Root Cause** This was caused by the assumption that at most one streaming listener returns a chunk for the same chunk. This assum...
diff --git a/dspy/streaming/streamify.py b/dspy/streaming/streamify.py index c31b7263f1..32d71aac53 100644 --- a/dspy/streaming/streamify.py +++ b/dspy/streaming/streamify.py @@ -185,12 +185,11 @@ async def async_streamer(*args, **kwargs): else: # We are receiving a chunk f...
1
1
0
[{"id": "G0", "claim": "The test's catch-all else clause assumes every non-citation, non-Prediction stream value has a 'chunk' attribute; consider type-checking with isinstance(value, dspy.streaming.StreamResponse) before accessing value.chunk.", "category": "correctness", "verdict": "supported", "priority": "P2", "sco...
null
stanfordnlp__dspy__8890
stanfordnlp/dspy
8,890
defect
1eccc38981042027838a69e8b96136406c3fc229
4977bb987caa2bb2c897dfea033581bb150f5ebf
fix: add fallback mechanism on missing end marker during streaming
Closes #8889 Strategy adopted: When the stream ends, we finalize the listeners by emitting tokens that might still be in the buffer, returning a StreamResponse with is_last_chunk=True.
diff --git a/dspy/streaming/streamify.py b/dspy/streaming/streamify.py index 32d71aac53..f3c77b43d6 100644 --- a/dspy/streaming/streamify.py +++ b/dspy/streaming/streamify.py @@ -193,6 +193,12 @@ async def async_streamer(*args, **kwargs): elif isinstance(value, StatusMessage): yiel...
5
4
1
[{"id": "G0", "claim": "The comment should not use the code-defined word \"Finalize\" and should instead say \"Flush remaining buffered tokens before yielding the `Prediction` instance\".", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The finalize...
null
stanfordnlp__dspy__8908
stanfordnlp/dspy
8,908
defect
2f9e9a01a181b4f6f864088be1c8ee984c95e404
bd0c380fe79c919ff0c9b603c238bf097e2493c8
fix(LM): Change default temperature and max_tokens to be None
Will allow users to just write dspy.LM("gpt-5-nano") but also there is the case where this overrides a user's settings. I can see an argument against this change, but it seems the direction we are heading is that API users have less explicit control over the temperature.
diff --git a/dspy/clients/lm.py b/dspy/clients/lm.py index 76f5b90c74..68e54ac9ae 100644 --- a/dspy/clients/lm.py +++ b/dspy/clients/lm.py @@ -88,7 +88,16 @@ def __init__( model_pattern = re.match(r"^(?:o[1345]|gpt-5)(?:-(?:mini|nano))?", model_family) if model_pattern: - if max_tokens < ...
2
2
1
[{"id": "G0", "claim": "The defaults should proceed as temperature=None and max_tokens=None, aligning with litellm defaults, instead of the PR's detect-and-coerce approach for default parameters.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Simplify th...
null
stanfordnlp__dspy__8911
stanfordnlp/dspy
8,911
defect
6224eb355602b44e5cae1ab8c33f8c613b6577d7
7fdfd7d1f9d8ffc29b174e8faef7b4ee63a56b04
Fix the issue of response_format for responses api
Closes #8872
diff --git a/dspy/clients/lm.py b/dspy/clients/lm.py index e6e3d7be47..56afeba231 100644 --- a/dspy/clients/lm.py +++ b/dspy/clients/lm.py @@ -470,6 +470,12 @@ def _convert_chat_request_to_responses_request(request: dict[str, Any]): elif isinstance(c, list): content_blocks.extend(c) ...
3
3
1
[{"id": "G0", "claim": "The new response_format conversion unconditionally overwrites any existing 'text' field in the request, losing its data; it should merge with an existing 'text' field if present.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": ...
null
stanfordnlp__dspy__8941
stanfordnlp/dspy
8,941
defect
1df5984007b7fd9bb56f3a8fba7a68b5517efb69
df802dc2cfbd2874a533b7c0e778d994cd322427
Exclude API keys from saved programs
- [x] Understand the issue - API keys are saved in plain text in both JSON and PKL files - [x] Locate relevant code in LM.dump_state() method in dspy/clients/lm.py - [x] Modify LM.dump_state() to exclude API keys - [x] Create comprehensive tests for the fix - [x] Run existing tests to ensure no regressions - [x] Manual...
diff --git a/dspy/clients/lm.py b/dspy/clients/lm.py index 366dd227f3..93446ed908 100644 --- a/dspy/clients/lm.py +++ b/dspy/clients/lm.py @@ -273,7 +273,10 @@ def dump_state(self): "launch_kwargs", "train_kwargs", ] - return {key: getattr(self, key) for key in state_keys} | se...
4
4
0
[{"id": "G0", "claim": "Do not create a new test file; add the API key exclusion test to the existing test_lm.py instead.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The exclusion filter only needs to check `api_key` rather than a set of mult...
null
stanfordnlp__dspy__8986
stanfordnlp/dspy
8,986
defect
aaadf05cd61e882089f96034a88ab75bc0b20628
6801afa3597d5fe3d186ddd508a98bac2665d03f
Introduce dspy.Reasoning to capture native reasoning from reasoning models
The reasoning models' response contains the reasoning content, and this PR introduce `dspy.Reasoning` so that the module output captures the native reasoning, instead of letting LM regenerate one. Usage: ``` import dspy dspy.configure(lm=dspy.LM("anthropic/claude-3-7-sonnet-20250219", cache=False)) class ...
diff --git a/dspy/__init__.py b/dspy/__init__.py index ea4c75a862..39d88c3908 100644 --- a/dspy/__init__.py +++ b/dspy/__init__.py @@ -6,7 +6,7 @@ from dspy.evaluate import Evaluate # isort: skip from dspy.clients import * # isort: skip -from dspy.adapters import Adapter, ChatAdapter, JSONAdapter, XMLAdapter, Two...
5
5
1
[{"id": "G0", "claim": "A comment should be added explaining why this streaming logic comes after the native response handling.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The string-conversion special cases for Reasoning should be implemente...
null
stanfordnlp__dspy__8993
stanfordnlp/dspy
8,993
defect
da69f9d05fc7509eb20c4acb41e8b8b793104f7e
71bd42a8bd34db9c5674bc4a2565f3f333c5f409
Fix content input conversion for OpenAI Responses API
## Summary Fixed a bug where the OpenAI Responses API fails when processing Image and text inputs. The issue was that content items were not being converted from the Chat API format to the Responses API format. ## Changes Made - **Added `_convert_content_item_to_responses_format()` helper function** to convert both im...
diff --git a/dspy/clients/lm.py b/dspy/clients/lm.py index 71a8934cc4..3562c360d8 100644 --- a/dspy/clients/lm.py +++ b/dspy/clients/lm.py @@ -468,7 +468,9 @@ def _convert_chat_request_to_responses_request(request: dict[str, Any]): if isinstance(c, str): content_blocks.append({"type": "inp...
3
3
2
[{"id": "G0", "claim": "Remove the docstrings from the new test cases.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The converted image item ({\"type\": \"input_image\", \"source\": {\"type\": \"url\", ...}}) may not match the interface docume...
null
stanfordnlp__dspy__9014
stanfordnlp/dspy
9,014
defect
5e72f7bbb609f28abe7fa2490812b5ed5dd8d8a6
3c12f604169d8b3aa97952e467a7345bdd6936a9
feat(File): add File type for handling file data
Support File input by introducing dspy.File. This is the last content type supported by OpenAI chat completion that is not supported by DSPy natively. Closes #8974 #8916 ```python lm = dspy.LM( model="openai/gpt-5-nano", temperature=1.0, ) dspy.configure(lm=lm) class QA(dspy.Signature): fil...
diff --git a/dspy/__init__.py b/dspy/__init__.py index ea4c75a862..01aad36757 100644 --- a/dspy/__init__.py +++ b/dspy/__init__.py @@ -6,7 +6,7 @@ from dspy.evaluate import Evaluate # isort: skip from dspy.clients import * # isort: skip -from dspy.adapters import Adapter, ChatAdapter, JSONAdapter, XMLAdapter, Two...
6
4
0
[{"id": "G0", "claim": "Add a `mime_type` argument to `File.from_file_id()` so clients that already know the file's MIME type can pass it, since a file ID's URI may not always contain the file extension and DSPy would otherwise have no way to determine the MIME type without reading the file contents.", "category": "des...
null
stanfordnlp__dspy__9047
stanfordnlp/dspy
9,047
defect
e6ad87c5ca568888e9c6674dd7dbacb4f4f62868
e79dc12a7c7c7bb3d4e8799c992f6852cebd0665
fix(dspy): Example.toDict() fails to serialize dspy.History objects
## Plan: Fix Example.toDict() serialization for dspy.History objects ### Problem `Example.toDict()` fails to serialize examples containing `dspy.History` objects because the `convert_to_serializable` function doesn't handle Pydantic models properly. This causes JSON serialization failures in `Evaluate.save_as_json()`....
diff --git a/dspy/evaluate/evaluate.py b/dspy/evaluate/evaluate.py index 50513ce8e2..90e48ae954 100644 --- a/dspy/evaluate/evaluate.py +++ b/dspy/evaluate/evaluate.py @@ -231,9 +231,12 @@ def _prepare_results_output( ): return [ ( - merge_dicts(example, prediction) | {metric_na...
3
3
0
[{"id": "G0", "claim": "The toDict() serialization change in _prepare_results_output is unnecessary once Example handles History, and merge_dicts should call toDict itself if needed.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new History tests sh...
null
stanfordnlp__dspy__9048
stanfordnlp/dspy
9,048
defect
e6ad87c5ca568888e9c6674dd7dbacb4f4f62868
23d3be771887255115f1459997b4c5de207617b8
Add guards against loading pkl files
Adds a guard against loading pkl files in individual programs without an argument or environment variable set.
diff --git a/docs/docs/tutorials/games/index.ipynb b/docs/docs/tutorials/games/index.ipynb index 279d49cf02..1e7b26c709 100644 --- a/docs/docs/tutorials/games/index.ipynb +++ b/docs/docs/tutorials/games/index.ipynb @@ -746,6 +746,13 @@ "If you want to load and use the agent program, you can do that as follows." ...
5
3
1
[{"id": "G0", "claim": "The warning logged in the save method says \"Loading .pkl files can run arbitrary code\" even though this is a save operation, so it should be reworded to reflect saving (or moved to the load method where the risk occurs).", "category": "documentation", "verdict": "uncertain", "priority": "P2", ...
null
stanfordnlp__dspy__9054
stanfordnlp/dspy
9,054
defect
fe03eadd78c71cd45ee555fe0483d50bcf737950
5c75877a681e2959aba03d29067d69d212ccd192
docs: add documentation for async tool usage and error handling
- Introduced a new section in tools.md detailing the use of async tools with examples for `acall` and synchronous calls using `allow_tool_async_sync_conversion`. - Updated error message in Tool class to clarify how to handle async tool calls. - Enhanced test for async tool call in sync mode to match the updated error...
diff --git a/docs/docs/learn/programming/tools.md b/docs/docs/learn/programming/tools.md index 757421de01..4ec1bce869 100644 --- a/docs/docs/learn/programming/tools.md +++ b/docs/docs/learn/programming/tools.md @@ -213,6 +213,51 @@ the screenshot below: Native function calling automatically detects model support usi...
1
1
1
[{"id": "G0", "claim": "The sync-mode example in the tools documentation uses `asyncio.sleep(0.1)` without importing the `asyncio` module; add `import asyncio` to its imports.", "category": "documentation", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
stanfordnlp__dspy__9055
stanfordnlp/dspy
9,055
defect
5e72f7bbb609f28abe7fa2490812b5ed5dd8d8a6
54a8a35d030a3531e360140991a1e0c6699ca9b4
Add param to load_memory_cache to stop pkl files without explicit loading
Add param to load_memory_cache to stop loading pkl files without explicit parameter The downside is that this doesn't provide an alternative to using pkl for cache storage
diff --git a/dspy/clients/cache.py b/dspy/clients/cache.py index 72291d8455..5f58f47db9 100644 --- a/dspy/clients/cache.py +++ b/dspy/clients/cache.py @@ -170,7 +170,11 @@ def save_memory_cache(self, filepath: str) -> None: with open(filepath, "wb") as f: cloudpickle.dump(self.memory_cache...
1
1
0
[{"id": "G0", "claim": "The error message should wrap allow_pickle in backticks so the parameter name renders as code.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
stanfordnlp__dspy__9073
stanfordnlp/dspy
9,073
defect
eb29c476fc2272f3436e357158fefd6c0933effc
2497b19746429770239f2100d50f5876360dc27a
FIX: streamify was appending StatusStreamingCallback directly to the shared settings.callbacks list
### Fix streaming status message callback mutation **Bug** `streamify` was appending `StatusStreamingCallback` directly to the shared `settings.callbacks` list. That list was mutated in place and reused across calls, callbacks (and their status message providers) leaked between different `dspy.streamify(...)`...
diff --git a/dspy/streaming/streamify.py b/dspy/streaming/streamify.py index d8ec56eb2f..8565f98a72 100644 --- a/dspy/streaming/streamify.py +++ b/dspy/streaming/streamify.py @@ -3,6 +3,7 @@ import logging import threading from asyncio import iscoroutinefunction +from copy import deepcopy from queue import Queue f...
2
2
1
[{"id": "G0", "claim": "deepcopy of settings.callbacks may fail in many cases; the reviewer suggests a shallow copy plus dspy.context(callbacks=callbacks) instead.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The test should be refactored to run t...
null
stanfordnlp__dspy__9110
stanfordnlp/dspy
9,110
defect
90eabeeb9f63133d92d5cf8efec2385b5e5f4373
ae1b52ade7ec85dc30f55f3cdaf3a9746d3586cf
Fix ContextWindowExceededError after 3 retries in react loop
## 📝 Changes Description `_call_with_potential_trajectory_truncation` was implicitly returning `None` after exhausting 3 retry attempts, causing `AttributeError: 'NoneType' object has no attribute 'next_thought'` when accessing the prediction. **Fix:** - Raise explicit `ValueError` when retries are exhausted - The `...
diff --git a/dspy/predict/react.py b/dspy/predict/react.py index 5f87879f80..8fa3ce742c 100644 --- a/dspy/predict/react.py +++ b/dspy/predict/react.py @@ -152,7 +152,16 @@ def _call_with_potential_trajectory_truncation(self, module, trajectory, **input ) except ContextWindowExceededError: ...
4
4
0
[{"id": "G0", "claim": "The try-catch around truncate_trajectory in _call_with_potential_trajectory_truncation (and its async counterpart) is not needed and should be removed.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new test functions should n...
null
stanfordnlp__dspy__9112
stanfordnlp/dspy
9,112
defect
90eabeeb9f63133d92d5cf8efec2385b5e5f4373
a87086c251329e4346ed675e0eaf52b36fbcc8eb
Enhance StreamListener to support generic type annotations for output
Closes #9099
diff --git a/dspy/streaming/streaming_listener.py b/dspy/streaming/streaming_listener.py index 5c1cc144df..4080f26cdd 100644 --- a/dspy/streaming/streaming_listener.py +++ b/dspy/streaming/streaming_listener.py @@ -1,3 +1,4 @@ +import inspect import re from collections import defaultdict from queue import Queue @@ -...
1
1
0
[{"id": "G0", "claim": "The new generic-type-annotation test could confuse future maintainers and should be made easier to follow, e.g. by adding a few more chunks and a flush.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
stanfordnlp__dspy__9130
stanfordnlp/dspy
9,130
defect
b95e1017ed6778226700aeb86cf48a82e8158ea5
53552f898d3d5a5f86c0155c13614e879f602590
Fix Responses API structured outputs
Previous PR: https://github.com/stanfordnlp/dspy/pull/9123 Closes https://github.com/stanfordnlp/dspy/issues/9122. See the linked issue for an extended problem description + minimal reproducible example. ### Structured outputs fix My proposed fix mutates the response_format request argument into the proper for...
diff --git a/dspy/clients/lm.py b/dspy/clients/lm.py index f4885d470e..9df61ae035 100644 --- a/dspy/clients/lm.py +++ b/dspy/clients/lm.py @@ -6,6 +6,7 @@ from typing import Any, Literal, cast import litellm +import pydantic from anyio.streams.memory import MemoryObjectSendStream from asyncer import syncify @@ ...
2
2
1
[{"id": "G0", "claim": "Move all lines other than the lm(\"What is a good test answer?\", response_format=TestModel) call outside the mock.patch block in test_responses_api_with_pydantic_model_input.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The pr...
null
stanfordnlp__dspy__9160
stanfordnlp/dspy
9,160
defect
becb4c9e849a292f71a1f1623acd375aaa32edef
bc95298b54dcfb80cd97fe3b9ac4ce0e918e7da6
fix(dspy): prevent argument injection in LocalProvider subprocess calls
## 📝 Changes Description `LocalProvider.launch()` constructed subprocess commands via string concatenation and `.split()`, enabling CWE-88 argument injection and breaking paths with spaces. **Before:** ```python command = f"python -m sglang.launch_server --model-path {model} --port {port} --host 0.0.0.0" process = s...
diff --git a/dspy/clients/lm_local.py b/dspy/clients/lm_local.py index c937ee6e5a..efe62b6bcb 100644 --- a/dspy/clients/lm_local.py +++ b/dspy/clients/lm_local.py @@ -55,11 +55,21 @@ def launch(lm: "LM", launch_kwargs: dict[str, Any] | None = None): logger.info(f"We see that CUDA_VISIBLE_DEVICES is {os.environ...
1
1
0
[{"id": "G0", "claim": "The new test file should follow the testing structure of other tests in the repo: use pytest instead of unittest and avoid one-line comments in the test file.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
stanfordnlp__dspy__9169
stanfordnlp/dspy
9,169
defect
fd93c38ca0548beaf512d6e4c3506c04d291cdb4
2bcfe2f2aa942c710eaec6d77145a258fdebf1d4
Patch `dspy.gepa` to handle `list[dict]` output from a `dspy.LM`
Fixes #9168 The current reflection model in GEPA always expects a `str` to come from the `dspy.LM`: https://github.com/gepa-ai/gepa/blob/1b5eff5133be1015210e0512953c25a4b85ad454/src/gepa/proposer/reflective_mutation/base.py#L27-L28 This PR modifies `dspy.gepa` to extract the `"text"` values - assuming they exis...
diff --git a/dspy/clients/base_lm.py b/dspy/clients/base_lm.py index e8b893a09d..ef4cbad969 100644 --- a/dspy/clients/base_lm.py +++ b/dspy/clients/base_lm.py @@ -220,8 +220,8 @@ def _process_completion(self, response, merged_kwargs): outputs.append(output) - if all(len(output) == 1 for output i...
2
2
2
[{"id": "G0", "claim": "Handle the list[dict] output within dspy.GEPA instead of modifying BaseLM.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The PR's changed handling of list[dict]/reasoning outputs should be covered by tests.", "category": "testing...
null
stanfordnlp__dspy__9215
stanfordnlp/dspy
9,215
defect
172c33589ae3f393ffe5688ceb99d6e86274a4d3
bf9782f6ba1d1644d64388c9dadfa66894dfcbea
Update DSpy settings save / load methods
Update DSpy settings save / load methods: * For save method, add an argument `exclude_keys`, so that MLflow can use it easier, to exclude certain keys like `trace`. * For load method, conver it to a class method, and returns a dict instead of directly updating the global configure. This is easier for MLflow side ...
diff --git a/dspy/__init__.py b/dspy/__init__.py index 3de46932b8..b65ed557ba 100644 --- a/dspy/__init__.py +++ b/dspy/__init__.py @@ -23,6 +23,7 @@ # Singleton definitions and aliasing configure = settings.configure +load_settings = settings.load context = settings.context BootstrapRS = BootstrapFewShotWithRan...
6
5
2
[{"id": "G0", "claim": "Converting load() to a classmethod that returns a dict instead of calling configure() is a breaking change for existing code that calls dspy.settings.load(); a deprecation warning or migration guide should be added.", "category": "design", "verdict": "opposed", "priority": "P1", "scope": "introd...
null
stanfordnlp__dspy__9223
stanfordnlp/dspy
9,223
defect
cf92cb36d9d0a80501ee711968e08b369b472583
5ba83ba72897a20949e650451201be15999aefd6
fix(gepa): Remove enable_tool_optimization feature
Closes #9202 Removes the `enable_tool_optimization` feature (PR #8928). Mutating tool objects directly is not the right approach — GEPA's default instruction optimization is already general enough to optimize tool-using layers (e.g., ReAct) via their predictor instructions without special-casing tool modules.
diff --git a/dspy/teleprompt/gepa/gepa_utils.py b/dspy/teleprompt/gepa/gepa_utils.py index c9fa3e18f1..f04dd8c448 100644 --- a/dspy/teleprompt/gepa/gepa_utils.py +++ b/dspy/teleprompt/gepa/gepa_utils.py @@ -13,6 +13,7 @@ from dspy.adapters.types.base_type import Type from dspy.adapters.types.tool import Tool from ds...
3
3
2
[{"id": "G0", "claim": "The re-sync loop in build_program unconditionally appends a full tool schema onto ReAct instructions that already contain the schema baked in at init, so when a module's instruction is not replaced (e.g. the proposer returns None for improved_predictor_instruction) or build_program runs repeated...
null
stanfordnlp__dspy__9227
stanfordnlp/dspy
9,227
defect
970721b9911feb3205083585b1bd1935c5899647
78ece3c14cd02b03cd3e443764a52c464a23feef
fix: handle error responses from ColBERTv2 server
## PR Summary When the ColBERTv2 server returns an error response (e.g. `{"error": true, "message": "..."}`), the code was throwing `KeyError: 'topk'` which gave no indication of what actually went wrong. This PR checks for error responses before accessing the results and raises a `RuntimeError` with the server's erro...
diff --git a/dspy/dsp/colbertv2.py b/dspy/dsp/colbertv2.py index d6c01fb8b7..fceb98b394 100644 --- a/dspy/dsp/colbertv2.py +++ b/dspy/dsp/colbertv2.py @@ -44,7 +44,14 @@ def colbertv2_get_request_v2(url: str, query: str, k: int): payload = {"query": query, "k": k} res = requests.get(url, params=payload, timeo...
3
3
3
[{"id": "G0", "claim": "The new server-error and unexpected-response raises in colbertv2_get_request_v2 and colbertv2_post_request_v2 should raise ValueError instead of RuntimeError.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Add res.raise_for_status...
null
stanfordnlp__dspy__9233
stanfordnlp/dspy
9,233
defect
aa3a2cd6959027d5b379c2747e2d754f380602bf
15a4ee8a720842662f13e3b6ac5aebf0decdae17
fix(RLM): large variable injection
Pyodide's FFI (Foreign Function Interface) crashes when passing strings larger than 128MB between JavaScript and Python. This PR adds filesystem-based injection for large variables to work around this limit. Before: All variables were embedded directly in Python code: `code = f"data = {repr(large_string)}\n" + code...
diff --git a/dspy/primitives/python_interpreter.py b/dspy/primitives/python_interpreter.py index 830a591550..4fa6063959 100644 --- a/dspy/primitives/python_interpreter.py +++ b/dspy/primitives/python_interpreter.py @@ -23,6 +23,10 @@ logger = logging.getLogger(__name__) +# Pyodide's FFI crashes at exactly 128MB (1...
1
1
1
[{"id": "G0", "claim": "When any large variable is injected, the prepended `import json` followed by small assignments lets a caller-passed variable named `json` shadow the module, so subsequent large assignments like `data = json.loads(...)` fail with AttributeError; the reviewer asks that this be guarded (e.g., reser...
null
stanfordnlp__dspy__9248
stanfordnlp/dspy
9,248
defect
d05cb074f6229a5d198f219e8d3cd051d5cb8c83
8f6b3511b545c3e53e282b378a108282951ee377
Fix the request header in streaming mode
The request header was unintentionally dropped in the streaming mode.
diff --git a/dspy/clients/lm.py b/dspy/clients/lm.py index 9df61ae035..87d6380287 100644 --- a/dspy/clients/lm.py +++ b/dspy/clients/lm.py @@ -306,6 +306,7 @@ def _get_stream_completion_fn( request: dict[str, Any], cache_kwargs: dict[str, Any], sync=True, + headers: dict[str, Any] | None = None, ): ...
1
1
0
[{"id": "G0", "claim": "Rename `_get_headers` to a more informative name like `add_dspy_header` and move it to around line 359 so all header-manipulation logic sits in one place.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
stanfordnlp__dspy__9256
stanfordnlp/dspy
9,256
defect
73b2624943a55c390b8b449d5a6bfc02e0c2d500
a7f970fd202783770a90e1857dd476100b9e735d
fix(interpreter): Fix enable_read_paths with multiple files
## Summary Fix bug where `enable_read_paths` fails when mounting multiple files to the same `/sandbox/` directory. The original code tried to create the directory with `mkdir` and caught `EEXIST` errors by checking `e.message`. However, Pyodide's `ErrnoError` has no `message` property, causing the second file mount to...
diff --git a/dspy/primitives/runner.js b/dspy/primitives/runner.js index 1c1599b992..2eeb002a64 100644 --- a/dspy/primitives/runner.js +++ b/dspy/primitives/runner.js @@ -264,7 +264,10 @@ while (true) { try { pyodide.FS.mkdir(cur); } catch (e) { - if (!e.message?.includes('File exi...
2
2
0
[{"id": "G0", "claim": "The hard-coded `e.errno === 20` magic number may vary across Pyodide/Emscripten builds; prefer a symbolic check (e.g. `e.code === 'EEXIST'` or Pyodide's exported errno mapping) instead of a specific numeric value.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "i...
null
stanfordnlp__dspy__9302
stanfordnlp/dspy
9,302
defect
37a2c5feb0ccc4fa93d9f40b7e65da96bf5a0f48
40757a3521986cb3b79f1ad9ec36e3a3143eb261
fix(dspy): SemanticF1 and CompleteAndGrounded now return dspy.Prediction
## Plan: Fix SemanticF1 to return dspy.Prediction(score=score) ### Understanding - SemanticF1 is a Module in `/home/runner/work/dspy/dspy/dspy/evaluate/auto_evaluation.py` - Currently returns a raw float score or boolean (when trace is provided) - Should return `dspy.Prediction(score=score)` to follow dspy.Module inte...
diff --git a/dspy/evaluate/auto_evaluation.py b/dspy/evaluate/auto_evaluation.py index bca596df74..a5390811f6 100644 --- a/dspy/evaluate/auto_evaluation.py +++ b/dspy/evaluate/auto_evaluation.py @@ -1,5 +1,6 @@ from dspy.predict.chain_of_thought import ChainOfThought from dspy.primitives import Module +from dspy.prim...
4
4
0
[{"id": "G0", "claim": "Remove the module-level comment/docstring and the test method docstrings from tests/evaluate/test_auto_evaluation.py.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Remove the assertion comments from tests/evaluate/test_a...
null
stanfordnlp__dspy__9309
stanfordnlp/dspy
9,309
defect
4507ef323c4f65dfe43c50f2e217713578299bfe
7d218582c474c78e0f0663904417dc4e93039402
refactor(rlm): enhance code fence parsing and REPL entry formatting
The RLM module has the LLM write Python in markdown code fences (```python ... ```), which must be stripped before execution. Previously, _strip_code_fences used a permissive regex that silently passed through anything it couldn't parse — unlabeled fences, multiple blocks, or prose mixed with code would reach the inter...
diff --git a/dspy/predict/rlm.py b/dspy/predict/rlm.py index 66c011d234..d3fc7aea71 100644 --- a/dspy/predict/rlm.py +++ b/dspy/predict/rlm.py @@ -11,7 +11,6 @@ from __future__ import annotations import logging -import re import threading from concurrent.futures import ThreadPoolExecutor, as_completed from conte...
1
1
1
[{"id": "G0", "claim": "The new _strip_code_fences logic raises SyntaxError for any plain Python that merely contains ``` anywhere but does not start with a fence (a regression from previous behavior), breaking valid snippets such as markdown-processing code that should execute as plain Python and causing unnecessary i...
null
stanfordnlp__dspy__9313
stanfordnlp/dspy
9,313
defect
4507ef323c4f65dfe43c50f2e217713578299bfe
7cb0434a3e8cd0731f32012a7612ddf85aec47f4
feat(signature): add type validation for input fields
### Summary 1. Implement type validation for input fields used in signatures - Supports both string and class-based signatures. 2. Implement a check for fields used in a module invocation that are not defined in the signature. 3. Log a warning in case 1 or 2 is violated 4. Skip type validation for cases where the...
diff --git a/docs/docs/learn/programming/signatures.md b/docs/docs/learn/programming/signatures.md index ce3717b282..403ca5ec8d 100644 --- a/docs/docs/learn/programming/signatures.md +++ b/docs/docs/learn/programming/signatures.md @@ -204,6 +204,37 @@ class MyContainer: signature = dspy.Signature("query: MyContainer.Q...
4
4
2
[{"id": "G0", "claim": "The new type-validation warnings may fire on existing code that works fine (possibly including the tutorials), so their intrusiveness needs checking and there should be an easy way to suppress them such as a dspy.configure(...) flag.", "category": "design", "verdict": "supported", "priority": "P...
null
stanfordnlp__dspy__9328
stanfordnlp/dspy
9,328
defect
cfc076a98c1e5299d846e0e544a78f73df6034ac
701ca7aeb302275ac1524be3e7cd921de6aacb99
fix: run evaluation on main thread when num_threads=1
Closes #9150 ## Problem When using `dspy.Evaluate` with `num_threads=1`, work is still dispatched to a `ThreadPoolExecutor`. This breaks frameworks like [AppWorld](https://github.com/stonybrooknlp/appworld) and [Terminal Bench](https://github.com/laude-institute/terminal-bench) that call `signal.signal()` inside thei...
diff --git a/dspy/utils/parallelizer.py b/dspy/utils/parallelizer.py index 5b5544d3d3..c57f7bff95 100644 --- a/dspy/utils/parallelizer.py +++ b/dspy/utils/parallelizer.py @@ -47,6 +47,8 @@ def __init__( def execute(self, function, data): tqdm.tqdm._instances.clear() wrapped = self._wrap_function(...
2
2
0
[{"id": "G0", "claim": "The test's docstring unnecessarily mentions the issue number and the main-thread use case, and should be trimmed.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "More logic should be shared between _execute_sequential and _e...
null
stanfordnlp__dspy__9478
stanfordnlp/dspy
9,478
defect
b7d573b8224b8e2e270523748e13f0836edc0576
6dab8fdd685ab8c515460f8038ce0f608f899f4a
feat(retrievers): add EmbeddingsWithScores for similarity score access
## Motivation Expose similarity scores from the Embeddings retriever to enable thresholding, re-ranking and RAG dubaggability. Closes #9477 ## Summary I wasn't sure whether to change the Embeddings interface because it might break dependencies so I decided to expose a new very minimal EmbeddingsWithScores subclas...
diff --git a/dspy/retrievers/__init__.py b/dspy/retrievers/__init__.py index ffaf603bbd..89339ca03c 100644 --- a/dspy/retrievers/__init__.py +++ b/dspy/retrievers/__init__.py @@ -1,4 +1,4 @@ -from dspy.retrievers.embeddings import Embeddings +from dspy.retrievers.embeddings import Embeddings, EmbeddingsWithScores from...
5
4
0
[{"id": "G0", "claim": "The `strict=False` argument in the zip of `top_indices` and `top_scores` is unnecessary since the two are shaped identically, and dropping it would be slightly cleaner.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The d...
null
stanfordnlp__dspy__9521
stanfordnlp/dspy
9,521
defect
39a477d3b951065234376b2766ac95d4c5ad89e9
85e240d60a468ff00158babe5ceddfcaea72b8ca
Refactor: Introduce DSPy-owned `ContextWindowExceededError` to decouple error handling
**Related Epic:** Relates to #9514 **Context & Motivation** DSPy's core modules (like `ReAct` and some adapters) rely on catching `litellm.ContextWindowExceededError` to trigger fallback logic. If a user creates a custom `BaseLM` backend, they are forced to import and raise a `litellm` error, leaking litellm implem...
diff --git a/dspy/__init__.py b/dspy/__init__.py index cdeb4b777c..e7fa1bb6e3 100644 --- a/dspy/__init__.py +++ b/dspy/__init__.py @@ -10,6 +10,7 @@ from dspy.evaluate import Evaluate # isort: skip from dspy.clients import * # isort: skip from dspy.adapters import Adapter, ChatAdapter, JSONAdapter, XMLAdapter, Two...
2
2
0
[{"id": "G0", "claim": "The default message of ContextWindowExceededError should be expressed as a default value of the `message` parameter in the signature rather than via the `message or \"Context window exceeded\"` fallback in the constructor body.", "category": "design", "verdict": "supported", "priority": "P3", "s...
null
stanfordnlp__dspy__9629
stanfordnlp/dspy
9,629
defect
a10a05b5791e326242791d24e2d04a5e7466dc29
e8de4868e9b590c2196ade207f5690acf56c5ee1
Add restrict_pickle option for safe disk cache deserialization
## Problem DSPy uses `diskcache` with unrestricted `pickle.load` for disk cache deserialization. A corrupted or malicious cache file can execute arbitrary code on load. ## Solution Add an opt-in `restrict_pickle` parameter that swaps `pickle.load` with a restricted unpickler on the read path. **Depends on #9628.** ...
diff --git a/docs/docs/tutorials/cache/index.md b/docs/docs/tutorials/cache/index.md index 275882b3ee..a10c4b7092 100644 --- a/docs/docs/tutorials/cache/index.md +++ b/docs/docs/tutorials/cache/index.md @@ -81,6 +81,51 @@ This is especially beneficial when: - Working with long system prompts that remain constant - Ma...
4
2
0
[{"id": "G0", "claim": "The documentation states the log message will name the exact type that was rejected, but the actual log line only shows the cache key, not the type.", "category": "documentation", "verdict": "uncertain", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The debug log for a failed ...
null
stanfordnlp__stanza__1302
stanfordnlp/stanza
1,302
defect
71253bce59aea604e0b4cd3aa7388f6fda3ce1d6
d1e2cfe12ca687774adc218fa6c002b720e7ce20
manual MWT control in tokenization
## Description This is a followup to #1290 which allows manual control of MWT splitting via the `tokenize_postprocessor`. We implement this via a new attribute `MEXP=Yes` to denote pre-deliniated MWT that the MWT processor shouldn't touch. For instance: ```python nlp = stanza.Pipeline(lang="fr", processors="tok...
diff --git a/stanza/models/common/doc.py b/stanza/models/common/doc.py index 3e33567b8c..8245c6b1d5 100644 --- a/stanza/models/common/doc.py +++ b/stanza/models/common/doc.py @@ -17,6 +17,7 @@ multi_word_token_id = re.compile(r"([0-9]+)-([0-9]+)") multi_word_token_misc = re.compile(r".*MWT=Yes.*") +multi_word_expan...
13
11
1
[{"id": "G0", "claim": "The dispatch values (\"flatten\"/\"process\"/\"skip\") should be an enum instead of string constants.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Manual-expansion state should live in an attribute on the Token object rather tha...
null
stanfordnlp__stanza__1320
stanfordnlp/stanza
1,320
defect
5948c9fdb10d72b5a4361bf0d7fd44db343458d2
157f58d4d673808820ce78e4f5f60175182dc27e
Splitting out the optimizer utility + LR scheduler for PoS
This PR splits out the utility optimizer into separate parts for Bert and non-Bert; this method is backwards compatible, such that `get_optimizer` gets retained to be used for methods that have not yet been migrated, while a new `get_split_optimizer` is used for methods that desire an optimizer that has been split out....
diff --git a/stanza/models/common/utils.py b/stanza/models/common/utils.py index 39aadc40c5..467de26796 100644 --- a/stanza/models/common/utils.py +++ b/stanza/models/common/utils.py @@ -164,24 +164,7 @@ def harmonic_mean(a, weights=None): return sum(weights) / sum(w/x for x, w in zip(a, weights)) # tor...
3
3
1
[{"id": "G0", "claim": "In the PEFT branch of get_split_optimizer, trainable_params should iterate model.bert_model.parameters() (like the sibling get_optimizer block) because named_parameters already covers bert_model entries under a bert_model. prefix, so the name filtering distinction is unclear.", "category": "corr...
null
stanfordnlp__stanza__1335
stanfordnlp/stanza
1,335
defect
8b036a205424246daf3dbad2d1144d95ac63d3b1
cc1f81a78c90e8e5f29afd14ab27bc66042ed272
Peft sentiment
Add a PEFT wrapper for the Sentiment training. Works quite well on English, actually, even without splitting the optimizer or implementing any form of scheduling. With no finetuning, adding electra-large to the 3 class English dataset (SST plus a few other pieces) gets 70 Macro F1. The base finetuning gets between...
diff --git a/stanza/models/classifier.py b/stanza/models/classifier.py index f813bcc461..dafc59e6b2 100644 --- a/stanza/models/classifier.py +++ b/stanza/models/classifier.py @@ -229,6 +229,7 @@ def build_argparse(): parser.add_argument('--bert_model', type=str, default=None, help="Use an external bert model (requ...
2
2
2
[{"id": "G0", "claim": "The hard-coded modules_to_save=[\"pooler\"] fully-trains a pooler that does not exist for all languages' BERTs, and the improvement/size tradeoff of doing so should be measured before keeping it.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id"...
null
stanfordnlp__stanza__1336
stanfordnlp/stanza
1,336
defect
8a82fce8a335ead2bad097a34bbe0c4b3031231a
12f1e341cee3b75408ebffb91de63448ab555e8d
PEFT on Named Entity Recognition
- PEFT and training ops (wandb) updates for NER - optional two stage optimization (doesn't seem to help much) depends on #1337 and #1338 (merged)
diff --git a/stanza/models/ner/model.py b/stanza/models/ner/model.py index 48b7159b05..bd699e588c 100644 --- a/stanza/models/ner/model.py +++ b/stanza/models/ner/model.py @@ -72,6 +72,15 @@ def add_unsaved_module(name, module): # FIXME: possibly pos and depparse are all losing a finetuned transformer if loaded...
4
4
2
[{"id": "G0", "claim": "The parser should use the use_peft argument that add_peft_args already provides instead of adding a separate --peft flag.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The comment reads 'its above this line' but should read 'it's...
null
stanfordnlp__stanza__1437
stanfordnlp/stanza
1,437
defect
2a1c1aab6e906a6b8a80cc2764fad449e9bb5a36
5cac28d82ab94b79e6567acd90cf19dec3eda5b9
Mwt augment
Add augmentation for apostrophes to the MWT expander https://github.com/stanfordnlp/stanza/issues/1436
diff --git a/stanza/models/common/vocab.py b/stanza/models/common/vocab.py index 66c42fc861..4f77542d15 100644 --- a/stanza/models/common/vocab.py +++ b/stanza/models/common/vocab.py @@ -29,7 +29,7 @@ def __init__(self, data=None, lang="", idx=0, cutoff=0, lower=False): self.state_attrs = ['lang', 'idx', 'cuto...
2
1
0
[{"id": "G0", "claim": "Unless UD standardizes/sanitizes unicode, the augmentation's APOS set omits apostrophe-like quote marks used by other languages (e.g. Japanese/Chinese, U+02CA), so the reviewer asks whether other smart apostrophe/quote marks should be included.", "category": "correctness", "verdict": "supported"...
null
stanfordnlp__stanza__1470
stanfordnlp/stanza
1,470
defect
0b9a448fdf231ae6703616f2f05cd87f73b47797
516103e69fb874b781eec7ac3b667eeb8aec936a
Hebrew coref
Convert a Hebrew dataset, although not with very satisfactory results. Fix a crashing bug in the usage of transformers in the process (tokens being completely removed by the transformation)
diff --git a/stanza/models/coref/coref_config.toml b/stanza/models/coref/coref_config.toml index 18c546ae9c..c8dd411a97 100755 --- a/stanza/models/coref/coref_config.toml +++ b/stanza/models/coref/coref_config.toml @@ -216,6 +216,13 @@ lora = true lora_target_modules = [ "query", "value", "dense", "ffn", "full_layer" ...
1
1
0
[{"id": "G0", "claim": "The bert_learning_rate of 0.000025 in the new aleph_lora config should be checked, since LoRA on small models is very learning-rate sensitive.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
stanfordnlp__stanza__1533
stanfordnlp/stanza
1,533
defect
156f86bff61fe673c3930af5fcf7a44d66b28dac
96b4d6836f98ddb4432bdba9d66cc9685896987c
Add Morpheme Segmentation Processor
## Description This pull request integrates morpheme segmentation from the [MorphSeg package](https://github.com/TheWelcomer/MorphSeg) into the Stanza library. It does this by adding a MorphSeg processor which wraps the MorphSeg library. Morphemes are the smallest units of meaning in a language. ### Example Usage ...
diff --git a/setup.py b/setup.py index bbaac71c50..069d955414 100644 --- a/setup.py +++ b/setup.py @@ -124,6 +124,9 @@ 'streamlit', 'ipython', ], + 'morphseg': [ + 'morphseg>=0.2.0', + ] }, # If there are data files included in your packages that n...
5
4
2
[{"id": "G0", "claim": "The log line in stanza/tests/setup.py announces downloading models for the morphseg tests while only the stanza tokenizer for each language is downloaded, and the reviewer asked that the logger.info be updated to reflect that.", "category": "documentation", "verdict": "supported", "priority": "P...
null
starfederation__datastar-python__15
starfederation/datastar-python
15
defect
f5ecafd78c25e0a520ec2d59ac55a3678f314305
63e6c76f59a14bf959caf0a50f40a59d0cac20e6
chore(lint): enable Ruff's pydocstyle (D) rules
This commit updates the linter configuration to enable the `pydocstyle` rule set, which is identified by the "D" prefix in Ruff. Enforcing docstring conventions will help improve code clarity and make the project easier to maintain and for new contributors to understand.
diff --git a/examples/django/datastar/asgi.py b/examples/django/datastar/asgi.py index 73df6db..d63624b 100644 --- a/examples/django/datastar/asgi.py +++ b/examples/django/datastar/asgi.py @@ -1,5 +1,4 @@ -""" -ASGI config for datastar project. +"""ASGI config for datastar project. It exposes the ASGI callable as a ...
1
1
0
[{"id": "G0", "claim": "The pull request should disable Ruff's pydocstyle imperative-mood rule (D401) and leave the AttributeGenerator and datastar_response docstrings as they were, since the rewritten wording is not an improvement.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "in...
null
starfederation__datastar-python__27
starfederation/datastar-python
27
defect
a67237c4dc60a2ef2343fdf310f9e6827d620b42
90d9d41a954888eacd48085ab54c4357af59aef4
align datastar_response behavior with docs (tests, fixes, examples)
(PR statement heavily revised after initial submission; see comment below.) ### Problem @datastar_response returned a coroutine for sync handlers, so frameworks treated them as async and ran blocking work on the event loop. That stalls unrelated requests under load and produces “coroutine was never awaited” warni...
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..209a865 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + uv run --dev pytest diff --git a/README.md b/README.md index 2928d33..22fa668 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,10 @@ headers of the SSE response yourself....
3
3
2
[{"id": "G0", "claim": "Restore copy_current_request_context in the Quart datastar_response decorator, since the PR removed it and the reviewer asks why it is no longer needed (its removal unbinds quart.request/g across the internal await).", "category": "correctness", "verdict": "supported", "priority": "P1", "scope":...
null
starkware-libs__cairo__7451
starkware-libs/cairo
7,451
defect
6958420cd1e003e0d92e076bdb73f3eb15f70b10
75b6d60e179b90c8f8addb2f55daee2853ea2f9e
Refactor: Clap attribute macros from #[clap(...)] to #[arg(...)] and #[command(...)] in v4.x
This PR updates deprecated #[clap(...)] attributes to their modern equivalents in clap 4.x. The current codebase still uses outdated syntax that has been deprecated since version 4.0. By making this update, we ensure compatibility with future versions and maintain code quality. Fixes #7450
diff --git a/crates/bin/cairo-compile/src/main.rs b/crates/bin/cairo-compile/src/main.rs index db5aabcfda9..39eb803797c 100644 --- a/crates/bin/cairo-compile/src/main.rs +++ b/crates/bin/cairo-compile/src/main.rs @@ -29,7 +29,7 @@ impl From<crate::InliningStrategy> for cairo_lang_lowering::utils::InliningStrat /// Com...
4
4
1
[{"id": "G0", "claim": "Revert the newly added blank-line spacing between the struct fields in starknet-sierra-upgrade-validate/src/main.rs, as it is not related to the PR.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Drop the redundant empty ...
null
starkware-libs__cairo__7952
starkware-libs/cairo
7,952
defect
4f4bfb7ec00104e2fc548ff562daa84c8ee84dd9
60bd908b76412bb75e6d07554f87f8cc249f3866
Add an empty merge_block_builders with a test.
**Stack**: - #7955 - #7956 - #7952 ⬅ ⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do not merge manually using the UI - doing so may have unexpected results.*
diff --git a/crates/cairo-lang-lowering/src/fmt.rs b/crates/cairo-lang-lowering/src/fmt.rs index 08402893c05..03cce7102ee 100644 --- a/crates/cairo-lang-lowering/src/fmt.rs +++ b/crates/cairo-lang-lowering/src/fmt.rs @@ -102,7 +102,7 @@ impl DebugWithDb<LoweredFormatter<'_>> for BlockEnd { BlockEnd::Goto(b...
7
7
1
[{"id": "G0", "claim": "The test-data comment '// A single block with a single' is an incomplete sentence and should say what is single (a single block with a single tuple).", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new local indent helpe...
null
starkware-libs__cairo__8019
starkware-libs/cairo
8,019
defect
ee645ed8a46f4d6139c5bc7e8528ef74073433e6
38c27bafa4aef703d0bec6fd3ec394bd4c8f5753
Creating metadata only once.
**Stack**: - #8020 - #8019 ⬅ ⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do not merge manually using the UI - doing so may have unexpected results.*
diff --git a/Cargo.lock b/Cargo.lock index d6c4af62a81..5077e7f5bba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1019,6 +1019,7 @@ dependencies = [ "cairo-lang-sierra", "cairo-lang-sierra-generator", "cairo-lang-sierra-to-casm", + "cairo-lang-sierra-type-size", "cairo-lang-test-utils", "cairo-lang-utils", "...
1
1
1
[{"id": "G0", "claim": "The new ProgramRegistryInfo::new(&program).unwrap() in CasmContractClass::into_casm_contract_class should propagate the error with `?` (per the suggested ProgramRegistryInfo::new(&program)?) instead of unwrapping, so registry-building failures do not panic.", "category": "correctness", "verdict"...
null
starkware-libs__cairo__8035
starkware-libs/cairo
8,035
defect
28c2ce87e443465207ac4a5f5c3b9f8c23f0f602
12cb91ea70a91eefe24859c1ff24b2afa032ae73
flow_control: Add a skeleton and test for lower_graph.
**Stack**: - #8039 - #8038 - #8036 - #8035 ⬅ ⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do not merge manually using the UI - doing so may have unexpected results.*
diff --git a/crates/cairo-lang-lowering/src/lower/block_builder.rs b/crates/cairo-lang-lowering/src/lower/block_builder.rs index 1c48c6ebe47..7ed10af3f95 100644 --- a/crates/cairo-lang-lowering/src/lower/block_builder.rs +++ b/crates/cairo-lang-lowering/src/lower/block_builder.rs @@ -567,16 +567,49 @@ impl StructRecomp...
1
1
1
[{"id": "G0", "claim": "The location should be generated inside lower_graph_as_function — which already fetches the same expr the test uses — instead of the test computing it and passing it in as a parameter.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
starkware-libs__cairo__8050
starkware-libs/cairo
8,050
defect
1bdbfee3600035ab323c36d873b4b5747210c6f9
33ce5156b957df681b03759550d376e4256af159
Changed filesystem db to return queries by ref where applicale
**Stack**: - #8053 - #8050 ⬅ - #8044 ⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do not merge manually using the UI - doing so may have unexpected results.*
diff --git a/crates/cairo-lang-compiler/src/db.rs b/crates/cairo-lang-compiler/src/db.rs index b47fe71ae0e..f7d6925765b 100644 --- a/crates/cairo-lang-compiler/src/db.rs +++ b/crates/cairo-lang-compiler/src/db.rs @@ -230,16 +230,16 @@ pub fn validate_corelib(db: &(dyn FilesGroup + 'static)) -> Result<()> { let Som...
2
1
0
[{"id": "G0", "claim": "Semgrep reports a potential tainted-path (path traversal) finding: compile.rs line 107 builds a file path from potentially untrusted data without validation, which could allow an attacker to manipulate accessed files.", "category": "security", "verdict": "uncertain", "priority": "P1", "scope": "...
null
starkware-libs__cairo__8053
starkware-libs/cairo
8,053
defect
864f25cf45f3af4ec26434b9abb666e451f86549
f1ff5f977996a579569bab352eaa8193ae03a3a8
Filesystem inputs now return refs
**Stack**: - #8053 ⬅ - #8050 - #8044 ⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do not merge manually using the UI - doing so may have unexpected results.*
diff --git a/crates/cairo-lang-compiler/src/db.rs b/crates/cairo-lang-compiler/src/db.rs index b47fe71ae0e..f7d6925765b 100644 --- a/crates/cairo-lang-compiler/src/db.rs +++ b/crates/cairo-lang-compiler/src/db.rs @@ -230,16 +230,16 @@ pub fn validate_corelib(db: &(dyn FilesGroup + 'static)) -> Result<()> { let Som...
3
2
1
[{"id": "G0", "claim": "Semgrep reports that crates/cairo-lang-executable/src/compile.rs (L107) builds a file path from potentially untrusted data, which can lead to a path traversal vulnerability unless the input is validated and sanitized.", "category": "security", "verdict": "uncertain", "priority": "P1", "scope": "...
null
starkware-libs__cairo__8071
starkware-libs/cairo
8,071
defect
11e8dcdc991e408d46b85a38031702f3cfb251a0
bb899beab66b6d6f5e34e67914605b30baa0918f
flow_control: Support a basic if-let for simple enums.
**Stack**: - #8077 - #8075 - #8071 ⬅ ⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do not merge manually using the UI - doing so may have unexpected results.*
diff --git a/crates/cairo-lang-lowering/src/lower/context.rs b/crates/cairo-lang-lowering/src/lower/context.rs index 0afa9f8dc70..17be750ba44 100644 --- a/crates/cairo-lang-lowering/src/lower/context.rs +++ b/crates/cairo-lang-lowering/src/lower/context.rs @@ -423,7 +423,11 @@ pub type LoweringResult<'db, T> = Result<T...
2
2
1
[{"id": "G0", "claim": "FlowControlVar should not carry a semantic type field - the type could be taken from the context (it is known from the enum-match node) instead.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The create_node_for_enum function shou...
null
starkware-libs__cairo__8073
starkware-libs/cairo
8,073
defect
c4af99ab455b242e3f2457c971ea9f5df1b69a16
815c1fea5ef77b247862892ff6990f1a0070769c
Removed semantic arenas lifetime.
**Stack**: - #8078 - #8073 ⬅ ⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do not merge manually using the UI - doing so may have unexpected results.*
diff --git a/crates/cairo-lang-debug/src/debug.rs b/crates/cairo-lang-debug/src/debug.rs index 6afbcc36115..2c153553875 100644 --- a/crates/cairo-lang-debug/src/debug.rs +++ b/crates/cairo-lang-debug/src/debug.rs @@ -251,13 +251,6 @@ where } } -/// Trait for getting the value of an id_arena::Id. -/// This is us...
1
1
0
[{"id": "G0", "claim": "The new `define_arena_id!` macro essentially reimplements DefaultArenaBehaviour, and the reviewer suggests the behaviour is only needed on a type that doesn't contain 'db, so a new struct could be defined to type the arena id on (or id_arena could be upgraded), which might be less maintenance.",...
null
starkware-libs__cairo__8093
starkware-libs/cairo
8,093
defect
6b534d5e5f48d004b779ad16115376afea778e6d
f680a1f2599ac0f81cce9818cdce6ccc2d549b8c
flow_control: Support match expressions.
**Stack**: - #8097 - #8096 - #8094 - #8093 ⬅ ⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do not merge manually using the UI - doing so may have unexpected results.*
diff --git a/crates/cairo-lang-lowering/src/borrow_check/test_data/borrow_check b/crates/cairo-lang-lowering/src/borrow_check/test_data/borrow_check index 69afb022f55..8498fea8afa 100644 --- a/crates/cairo-lang-lowering/src/borrow_check/test_data/borrow_check +++ b/crates/cairo-lang-lowering/src/borrow_check/test_data/...
3
2
0
[{"id": "G0", "claim": "Asks whether the `skip_lowering: false` configuration was removed from the `test_create_graph` calls in the `if` test data, where the pull request dropped the explicit `skip_lowering: false` argument.", "category": "testing", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id":...
null
starkware-libs__cairo__8140
starkware-libs/cairo
8,140
defect
e7fd620adf50a4f66503ab9d5af456f2a24a9573
b66fa78840d6f9d97a09359a3787de77915c94fe
flow-control: Add diagnostics mechanism.
**Stack**: - #8180 - #8179 - #8178 - #8143 - #8142 - #8141 - #8140 ⬅ ⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do not merge manually using the UI - doing so may have unexpected results.*
diff --git a/crates/cairo-lang-lowering/src/lower/flow_control/create_graph.rs b/crates/cairo-lang-lowering/src/lower/flow_control/create_graph.rs index b9f7b38e196..f6abf10e7b3 100644 --- a/crates/cairo-lang-lowering/src/lower/flow_control/create_graph.rs +++ b/crates/cairo-lang-lowering/src/lower/flow_control/create_...
1
1
1
[{"id": "G0", "claim": "Make the builder's diagnostics field a reference that adds directly to the original context, so early returns cannot accidentally drop the diagnostics.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
starkware-libs__cairo__8189
starkware-libs/cairo
8,189
defect
4a1a071622df5c2a91d0317f21736636dbc5df4c
d814efa1f9534ecc213c06239ad42a8386c69919
ExternalFiles to a db held function object
Changed external files from a trait on a Database object (which Filesgroup depended on), to a function object initialized when initializing the db. Behaviour should be the same, but code should be less coupled. This is a preparation step to remove QueryGroup from FilesGroup
diff --git a/crates/cairo-lang-compiler/src/db.rs b/crates/cairo-lang-compiler/src/db.rs index f7d6925765b..450150d89c3 100644 --- a/crates/cairo-lang-compiler/src/db.rs +++ b/crates/cairo-lang-compiler/src/db.rs @@ -1,15 +1,15 @@ use std::sync::Arc; use anyhow::{Result, anyhow, bail}; -use cairo_lang_defs::db::{De...
2
2
0
[{"id": "G0", "claim": "The new `pub type TryExtAsVirtual` alias lacks a doc comment.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The member functions of the new `impl ExternalFiles` block lack doc comments.", "category": "documentation", "verd...
null
starkware-libs__cairo__8217
starkware-libs/cairo
8,217
defect
dd0ff7bf6830aabea694cdadfef5cef5dd0b120c
a4907ba2317846b1c97618861d6583bb013c47eb
Added cse optimization.
**Stack**: - #8219 - #8218 - #8217 ⬅ ⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do not merge manually using the UI - doing so may have unexpected results.*
diff --git a/crates/cairo-lang-lowering/src/optimizations/cse.rs b/crates/cairo-lang-lowering/src/optimizations/cse.rs new file mode 100644 index 00000000000..17e86d21c0f --- /dev/null +++ b/crates/cairo-lang-lowering/src/optimizations/cse.rs @@ -0,0 +1,140 @@ +#[cfg(test)] +#[path = "cse_test.rs"] +mod test; + +use st...
4
3
0
[{"id": "G0", "claim": "A doc comment should be added to `snapshot_mappings` explaining what the mapping holds (e.g. that Statement::Snapshot[v3] = v5 means v5 was renamed to v3 by the snapshot operation).", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "cla...
null
starkware-libs__cairo__8226
starkware-libs/cairo
8,226
defect
6451531c976d9f7c17ebd71231f8e4faed1fc0b0
7e9fed69152412f88b84f9212676b6637a8f0807
Cleaning up Defs and debug_test query groups
### TL;DR Move from query groups using `#[salsa::transparent]` on trait methods and `#[salsa::tracked]` on implementations. ### What changed? - Added `#[salsa::transparent]` to many query functions in `DefsGroup` trait to avoid unnecessary cloning - Converted several functions to use `#[salsa::tracked]` to still le...
diff --git a/Cargo.lock b/Cargo.lock index b5f2be36208..9c038572621 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -693,7 +693,6 @@ dependencies = [ "cairo-lang-defs", "cairo-lang-diagnostics", "cairo-lang-filesystem", - "cairo-lang-parser", "cairo-lang-plugins", "cairo-lang-proc-macros", "cairo-lang-semantic"...
3
3
0
[{"id": "G0", "claim": "If the newly added FileId::dummy helper is actually required, it should carry a doc comment explaining its purpose.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "In warmup_diagnostics_blocking, the per-module loop reads be...
null
starkware-libs__cairo__8254
starkware-libs/cairo
8,254
defect
546fa8cd3f8fb03edc44e2e24f7f6deb502193a9
39986b1a83aa17fd5b836c71c9fb186a0c883149
flow-control: Add non-exhaustive error.
**Stack**: - #8256 - #8253 - #8255 - #8254 ⬅ ⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do not merge manually using the UI - doing so may have unexpected results.*
diff --git a/crates/cairo-lang-lowering/src/lower/flow_control/create_graph.rs b/crates/cairo-lang-lowering/src/lower/flow_control/create_graph.rs index 97dd28932a7..79b19b4af83 100644 --- a/crates/cairo-lang-lowering/src/lower/flow_control/create_graph.rs +++ b/crates/cairo-lang-lowering/src/lower/flow_control/create_...
1
1
0
[{"id": "G0", "claim": "In the Err(diag_added) arm of lower_graph_as_function in graph_test.rs, the returned Lowered should be built directly from ctx (diagnostics: ctx.diagnostics.build(), variables: ctx.variables.variables) as in the suggested snippet, instead of via std::mem::take.", "category": "maintainability", "...
null
starkware-libs__cairo__8534
starkware-libs/cairo
8,534
defect
d8b850c38d4e758a8439e5d1d94388b8242f4e1c
8d434f3f98e741ca3044e0fe03cd49f7f719116d
Using MiMallocator for better performance
### TL;DR Added mimalloc as the global allocator for all Cairo binaries to improve memory management. ### What changed? - Added mimalloc as a dependency in the workspace Cargo.toml - Configured mimalloc as the global allocator in all binary crates: - cairo-compile - cairo-execute - cairo-format - cairo-size-...
diff --git a/Cargo.lock b/Cargo.lock index 33cb0000602..881278d01c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -437,6 +437,7 @@ dependencies = [ "cairo-lang-utils", "clap", "log", + "mimalloc", "tracing", ] @@ -456,6 +457,7 @@ dependencies = [ "cairo-lang-sierra-generator", "cairo-vm", "clap", + "mima...
2
2
1
[{"id": "G0", "claim": "Seems CI is still degraded.", "category": "performance", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The global allocator should drop the `use` and fully qualify the type, e.g. `#[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMallo...
null
starkware-libs__cairo__8577
starkware-libs/cairo
8,577
defect
a01206a08039075f03565f444aad115980167388
fe72798f52c33a76882e2eab91371c55d85829d3
feat: Add &T to parser, semantic not implemented yet
Note: change in `attribute_errors` are since `&` can now also be Unary, and the test wanted to test a missing binary operator, so `/` is now the binary operator used to keep the spirit of the test without changing the diff.
diff --git a/crates/cairo-lang-formatter/src/node_properties.rs b/crates/cairo-lang-formatter/src/node_properties.rs index efb24531e53..4b6fb1120b7 100644 --- a/crates/cairo-lang-formatter/src/node_properties.rs +++ b/crates/cairo-lang-formatter/src/node_properties.rs @@ -150,7 +150,7 @@ impl<'a> SyntaxNodeFormat for S...
1
1
0
[{"id": "G0", "claim": "The newly added UnaryOperator::Reference arm in core_unary_operator should be unreachable like the At and Desnap arms instead of todo!().", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
starkware-libs__cairo__8619
starkware-libs/cairo
8,619
defect
55be967e5066803fa083a1eae2581df2b8b7c795
ca9b908da5bae73aa8404f3666c78c5aab52ead8
(optimization): felt252_div constant propogation support
### TL;DR Add constant folding support for the `felt252_div` libfunc in the lowering phase. ### What changed? - Added constant folding for the `felt252_div` libfunc with three optimization cases: 1. Division by 1 returns the original value 2. Division of 0 by any non-zero value returns 0 3. Division of two con...
diff --git a/crates/cairo-lang-lowering/src/optimizations/const_folding.rs b/crates/cairo-lang-lowering/src/optimizations/const_folding.rs index fcc519b3348..15b83cb6c3f 100644 --- a/crates/cairo-lang-lowering/src/optimizations/const_folding.rs +++ b/crates/cairo-lang-lowering/src/optimizations/const_folding.rs @@ -499...
2
2
0
[{"id": "G0", "claim": "The rhs_felt non-zero conversion and the field_div call should be chained into a let chain instead of binding rhs_nonzero with expect(\"Non-zero divisor\").", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The unwrap_or_els...
null
starkware-libs__cairo__8736
starkware-libs/cairo
8,736
defect
adcd081162f834f848cf610b8a430327501165c8
bec6c51674d33d1fb099de5be95072fc5e5f970f
Remove redundant format! calls when emitting Cairo artifacts
replace format!("{value}") with direct .to_string() in cairo-compile and sierra-compile output paths to skip unnecessary formatting scaffolding, adjust the resolve-labels test to build its assertions via .to_string() for the same reason, no runtime behaviour changes expected
diff --git a/crates/bin/cairo-compile/src/main.rs b/crates/bin/cairo-compile/src/main.rs index 5dc9b41ce74..97d92afd9ec 100644 --- a/crates/bin/cairo-compile/src/main.rs +++ b/crates/bin/cairo-compile/src/main.rs @@ -67,7 +67,7 @@ fn main() -> anyhow::Result<()> { match args.output { Some(path) => { - ...
1
1
0
[{"id": "G0", "claim": "Run ./scripts/rust_fmt.sh to format the code to the project's rustfmt style.", "category": "style", "verdict": "supported", "priority": "P3", "scope": "introduced"}]
null
starkware-libs__cairo__8787
starkware-libs/cairo
8,787
defect
cdaeb86f8033e4cb332eb8199a53026acfa72f26
d8169aff7e46a578d35eb3f3ab13bd448866b485
Move sierra debug info to separate module
No business logic changes besides making local functions private
diff --git a/crates/cairo-lang-defs/src/db.rs b/crates/cairo-lang-defs/src/db.rs index 02baf427b3d..4f6c6218fb2 100644 --- a/crates/cairo-lang-defs/src/db.rs +++ b/crates/cairo-lang-defs/src/db.rs @@ -1873,7 +1873,7 @@ pub trait DefsGroupEx: DefsGroup { /// /// *Note*: Sets the following Salsa input: `DefsGro...
3
2
0
[{"id": "G0", "claim": "The StatementsLocations.locations map could possibly hold a single LocationId per statement instead of a Vec<StableLocation>, converting to a vector only in the final phase - but probably not in this PR.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, ...
null
starkware-libs__cairo__9046
starkware-libs/cairo
9,046
defect
482afce5f4cd2c1c2e0c6b2357b5021695904877
d8fe4c1566f1984059d8758ba131aa94195c84ae
feat: alloc_local large box values and use local_into_box
\- Box(T) with |T| >= 3 become locals, so that local_into_box can be used. \- Subject to dedicated db-flag.
diff --git a/crates/cairo-lang-filesystem/src/flag.rs b/crates/cairo-lang-filesystem/src/flag.rs index 8b917658587..7f7f2430320 100644 --- a/crates/cairo-lang-filesystem/src/flag.rs +++ b/crates/cairo-lang-filesystem/src/flag.rs @@ -20,6 +20,10 @@ pub enum Flag { /// /// Default is false as it makes panic unp...
6
6
3
[{"id": "G0", "claim": "Revert crates/cairo-lang-filesystem/src/flag.rs and use the existing \"sierra_future\" flag (which should exist after rebasing) instead of adding a new LocalIntoBoxOptimization flag.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "...
null
starkware-libs__cairo__9265
starkware-libs/cairo
9,265
defect
e22b09677f6eb49937871079d7a18dea80d61a43
33ac7bc757e1eb193408990d1d520e6fc3eb8727
(feature): Contextualized path for shorter and readable diagnostics
## Summary Added a new `path` module that provides functionality to find the shortest valid path to an item from a module context. This improves error messages by showing contextualized paths instead of full paths, making them more readable and relevant to the user's current module. --- ## Type of change Please che...
diff --git a/crates/cairo-lang-defs/src/ids.rs b/crates/cairo-lang-defs/src/ids.rs index eea40ad1f59..e6196e1ceab 100644 --- a/crates/cairo-lang-defs/src/ids.rs +++ b/crates/cairo-lang-defs/src/ids.rs @@ -70,7 +70,7 @@ pub trait TopLevelLanguageElementId<'db>: NamedLanguageElementId<'db> { } fn full_path(&s...
14
12
1
[{"id": "G0", "claim": "The PR should get the module context externally, since diagnostics are collected per module to begin with, instead of adding a context_module field to diagnostic kinds such as AmbiguousTrait.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "...
null
starkware-libs__cairo__9553
starkware-libs/cairo
9,553
defect
00a0d9794c53ae794b1fd3097f494431cbc2dd7d
0145bacb516b0b3adba735649662367266da6183
Lowering: Support enum_boxed_match for Box<Enum> matching
## Summary Enhances pattern matching to support boxed types in match expressions, allowing for more complex pattern matching scenarios with nested types. --- ## Type of change Please check **one**: - [ ] Bug fix (fixes incorrect behavior) - [x] New feature - [ ] Performance improvement - [ ] Documentation change w...
diff --git a/crates/cairo-lang-lowering/src/lower/flow_control/create_graph/patterns.rs b/crates/cairo-lang-lowering/src/lower/flow_control/create_graph/patterns.rs index c90eb148da6..3e8cbe24cf4 100644 --- a/crates/cairo-lang-lowering/src/lower/flow_control/create_graph/patterns.rs +++ b/crates/cairo-lang-lowering/src...
6
6
0
[{"id": "G0", "claim": "In the added try_extract_box_inner_type, the parent-module check is redundant because the Box extern type won't be duplicated, so it should be simplified per the suggested let-else destructuring.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {...
null
starkware-libs__cairo__9597
starkware-libs/cairo
9,597
defect
4a2e7e30adb5357743f1ab712a1e1174ee66d97b
9cbc1228197409a7f9efc5d3260b2be36dd3b149
feat: Dataflow forward equality analysis
## Summary Added an equality analysis module to track semantic equivalence between variables in lowered IR. The analysis uses a union-find data structure to efficiently track equivalence classes, with additional tracking for box/unbox and snapshot/desnap relationships between classes. --- ## Type of change Please c...
diff --git a/Cargo.toml b/Cargo.toml index 4fc3f22a943..a5bc297ecbc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -146,6 +146,7 @@ serde = { version = "1.0.219", default-features = false, features = ["derive", " serde_json = "1.0.142" sha2 = "0.10.9" sha3 = "0.10.8" +smallvec = "1.15.1" smol_str = { version = "0.3.2"...
6
5
1
[{"id": "G0", "claim": "The merge keeps an equality only when both branches yield the same union-find representative, but representatives are order-dependent, so identical classes built in different union orders are dropped and the analysis misses equalities that hold on all paths; it should compare class membership or...
null
starkware-libs__cairo__9630
starkware-libs/cairo
9,630
defect
c9153f8dcf7e9bda37f9c88157ae0ec968f08b0b
ac232c912efea37b326653dfa0668235d15ba10b
(feat): Using criterion benchmarking framework with simple compile benchmark
## Summary Added benchmarking capabilities to the Cairo compiler using Criterion. This PR introduces a new benchmark for measuring compilation performance, starting with a simple Fibonacci example. --- ## Type of change Please check **one**: - [ ] Bug fix (fixes incorrect behavior) - [ ] New feature - [x] Performa...
diff --git a/Cargo.lock b/Cargo.lock index b6e79bfd380..3d2def25649 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,12 +29,27 @@ dependencies = [ "memchr", ] +[[package]] +name = "alloca" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7d05ea6aea7e9e64d25b9156ba...
1
1
0
[{"id": "G0", "claim": "The new compile benchmark should be included in the `tests` crate rather than living in the `cairo-lang-compiler` crate.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
starkware-libs__cairo__9631
starkware-libs/cairo
9,631
defect
4a2e7e30adb5357743f1ab712a1e1174ee66d97b
7a3206245ecaec089129b9bef2adc1a6884077b4
(ci): Added benchmarking to nightly
## Summary Added a new benchmark job to the nightly workflow that runs cargo benchmarks and stores the results. The benchmark job: 1. Runs only on the main repository 2. Uses rust-cache for faster builds 3. Executes `cargo bench` and captures output 4. Stores benchmark results using the benchmark-action 5. Pushes res...
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 794a2bb3117..2db3b3ad51a 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -45,6 +45,37 @@ jobs: - uses: actions/checkout@v6 - uses: crate-ci/typos@master + benchmark: + if: github.reposi...
2
1
1
[{"id": "G0", "claim": "The `Run benchmarks` step pipes `cargo bench` into `tee`, so the pipeline can succeed even when `cargo bench` itself fails and a broken benchmark run can still proceed to store and push results; add `set -o pipefail` (or avoid the pipe) so benchmark failures fail the job.", "category": "correctn...
null
starkware-libs__cairo__9870
starkware-libs/cairo
9,870
defect
cb089a7bb71870d359a7af8c058f8089bdfca068
21bf47fb36fe53f63f7de8a8fff50bce1728d744
(feat): def site analysis based on forward dataflow
## Summary Adds a `DefLocation` enum and a `DefSiteAnalysis` pass to the lowering analysis framework. `DefLocation` distinguishes between variables defined at block entry (function parameters, goto remapping destinations, match arm bindings) and variables defined as outputs of a statement. `DefSiteAnalysis` implements...
diff --git a/crates/cairo-lang-lowering/src/analysis/def_site.rs b/crates/cairo-lang-lowering/src/analysis/def_site.rs new file mode 100644 index 00000000000..310cfb52a9b --- /dev/null +++ b/crates/cairo-lang-lowering/src/analysis/def_site.rs @@ -0,0 +1,126 @@ +//! Def-site analysis for lowered IR. +//! +//! Records wh...
4
4
1
[{"id": "G0", "claim": "The `DefLocation::block()` method has zero callers anywhere and should not be shipped as dead public API.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Initializing `def_sites` with `(BlockId(lowered.blocks.len()), 0)` u...
null
starkware-libs__cairo__9871
starkware-libs/cairo
9,871
defect
cb089a7bb71870d359a7af8c058f8089bdfca068
89d473ebfbb60f842111108d0f3037fa61dd1af7
(feat): dominator analysis using forward dataflow
## Summary Adds a block dominator analysis pass to the lowering IR. The analysis computes, for each block, the set of all blocks that dominate it (i.e., every path from the entry block to that block must pass through each dominator). The implementation uses the existing forward dataflow framework, with set intersectio...
diff --git a/crates/cairo-lang-lowering/src/analysis/def_site.rs b/crates/cairo-lang-lowering/src/analysis/def_site.rs new file mode 100644 index 00000000000..310cfb52a9b --- /dev/null +++ b/crates/cairo-lang-lowering/src/analysis/def_site.rs @@ -0,0 +1,126 @@ +//! Def-site analysis for lowered IR. +//! +//! Records wh...
3
3
0
[{"id": "G0", "claim": "Rename the abbreviated `dom` naming to the full name `dominator` (file dom.rs and its derived names).", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Explain or remove the unexplained `Option` wrapper in `dom_sets: Vec<Opt...
null
starkware-libs__cairo__9872
starkware-libs/cairo
9,872
defect
cb089a7bb71870d359a7af8c058f8089bdfca068
aeb10da0feabe408fb9767c89e6789c1ba97b89d
(feat): merging analysis tests
## Summary Consolidates the separate `def_site_test.rs` and `dom_test.rs` test modules into a single unified `test_analysis` runner in `test.rs`. The new runner dispatches to the appropriate analysis (`dom` or `def_site`) based on an `analysis` arg declared in each test data file. A `Display` implementation is added t...
diff --git a/crates/cairo-lang-lowering/src/analysis/def_site.rs b/crates/cairo-lang-lowering/src/analysis/def_site.rs new file mode 100644 index 00000000000..310cfb52a9b --- /dev/null +++ b/crates/cairo-lang-lowering/src/analysis/def_site.rs @@ -0,0 +1,126 @@ +//! Def-site analysis for lowered IR. +//! +//! Records wh...
1
1
0
[{"id": "G0", "claim": "The `dom` analysis test entry in test.rs should be renamed (the reviewer's one-word comment 'inator' on the `dom: \"dom\",` line evidently asks for the name `dominator`).", "category": "naming", "verdict": "supported", "priority": "P3", "scope": "introduced"}]
null
starkware-libs__cairo_native__140
starkware-libs/cairo_native
140
defect
79b90517877bd7056a7d4db0cd549f5a335d82b2
22d6ccf10c375c858b1bec70db4b67a10f16f747
initial gas work
- Added gas counter global. - Added helper functions to modify the gas global. - Added types: gasbuiltin, builtincosts. - Added gas user function gas calculation, used to reduce current gas on function calls. - Implemented builtins: get_available_gas, withdraw_gas, withdraw_gas_all, branch_align, get_builtin_costs ...
diff --git a/cli/src/main.rs b/cli/src/main.rs index 6906825250..5f58c56a30 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -5,6 +5,7 @@ #![allow(unused)] use cairo_lang_compiler::{project::ProjectConfig, CompilerConfig}; +use cairo_lang_sierra::extensions::core::{CoreLibfunc, CoreType}; use cairo_lang_sierr...
3
3
1
[{"id": "G0", "claim": "Gas tracking needs thorough testing: all tests that do not depend on gas should also be run with some large amount of available gas to check the correct amount is used.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The comment s...
null
starkware-libs__cairo_native__153
starkware-libs/cairo_native
153
defect
55d39d6a74521709537779e54fd09c108181f2fc
43bf87487e48f2ddfd7a4ea56d36b8f4298ebf44
implement dictionaries
implements the dict libfuncs, fixes #61 ## Description Description of the pull request changes and motivation. ## Checklist - [ ] Linked to Github Issue - [ ] Unit tests added - [ ] Integration tests added. - [ ] This change requires new documentation. - [ ] Documentation has been added/updated.
diff --git a/sierra2mlir-utils/Cargo.toml b/sierra2mlir-utils/Cargo.toml index abe93dd3c8..d87fd70531 100644 --- a/sierra2mlir-utils/Cargo.toml +++ b/sierra2mlir-utils/Cargo.toml @@ -8,3 +8,4 @@ crate-type = ["lib", "cdylib", "staticlib"] [dependencies] starknet-crypto = "0.4.3" +ahash = "0.8.3" diff --git a/sierra...
8
6
1
[{"id": "G0", "claim": "The doc comment saying endianness doesn't matter is wrong; endianness does matter for the hash and should be pinned down in the doc.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The doc's '# Panics' section claims the fun...
null
starkware-libs__cairo_native__1558
starkware-libs/cairo_native
1,558
defect
25359bbab24f71cd43180b4b1a2ff9735c562d24
51c1118340824d7b998da03e94cba061c1cff0f8
added blake builtin counter for blake libfuncs
# Title Closes #NA <!-- added blake builtin counter for blake libfuncs --> ## Introduces Breaking Changes? No. <!-- Explain how this PR modifies the API. --> <!-- If the PR is breaking, then we need to update starknet-replay and our sequencer fork to comply with the latest changes. The follow...
diff --git a/Cargo.lock b/Cargo.lock index d9a2e98933..4448de08c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -93,9 +93,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.100" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a23eb6b1614318a8071c9b252...
3
3
1
[{"id": "G0", "claim": "Revert the reordering of the RuntimeBinding match arms that the pull request moved in src/metadata/runtime_bindings.rs.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The blake counter should be incremented directly inste...
null
starkware-libs__cairo_native__1589
starkware-libs/cairo_native
1,589
defect
645b5c7470f718afdf92b33e59bdffb51db4b28b
77ffb9b8ed06656e062c729928efb24b1aeb6a18
added e2e tests from cairo repo
# Added e2e tests from cairo repo Closes #NA <!-- Added tthe e2e tests from cairo repo to the CI by extracting the sierra section of the tests and compiling them. --> ## Introduces Breaking Changes? No. <!-- Reviewable:start --> - - - This change is [<img src="https://reviewable.io/review_button.svg" hei...
diff --git a/.github/workflows/starknet-blocks.yml b/.github/workflows/starknet-blocks.yml index 0aa901ceb..591325c9f 100644 --- a/.github/workflows/starknet-blocks.yml +++ b/.github/workflows/starknet-blocks.yml @@ -8,7 +8,6 @@ on: jobs: run-blocks: - if: false name: Run Blocks runs-on: ubuntu-lates...
6
6
0
[{"id": "G0", "claim": "The extract_e2e_sierra.py invocation does not belong inside the pull-external-projects target and should be run elsewhere.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The three get-then-insert guards for ReallocBindingsMeta in ...
null
starkware-libs__cairo_native__1594
starkware-libs/cairo_native
1,594
defect
b8c6890f36ce8e0f699ed31a41519f036bd7ecb0
5bd65c4284eb8689d81d58a5518e2ae88aa4ef20
fixed a bug with array slice index wrapping
# Fix u32 overflow in array_slice bounds check build_slice in src/libfuncs/array.rs computed slice_end = slice_start + slice_len in 32-bit arithmetic and then compared it against array_len with Ule. With an attacker-chosen slice_len = u32::MAX and slice_start ≥ 1, the sum wraps to a small value and the bounds...
diff --git a/src/libfuncs/array.rs b/src/libfuncs/array.rs index 4aebd7694..132bbb668 100644 --- a/src/libfuncs/array.rs +++ b/src/libfuncs/array.rs @@ -1185,24 +1185,23 @@ pub fn build_slice<'ctx, 'this>( let slice_start = entry.argument(2)?.into(); let slice_len = entry.argument(3)?.into(); - let slice...
1
1
0
[{"id": "G0", "claim": "Additionally document that the slice length is non-negative, so that the check that the slice end is smaller than the array's end is enough.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
starkware-libs__cairo_native__311
starkware-libs/cairo_native
311
defect
eb00476f36b3bbe9d8ee260a569e0ce2cbddaf93
e380036f02ef420043c05e1961720dd9746caddc
update to llvm 17
Updates to llvm 17 ## Checklist - [ ] Linked to Github Issue - [ ] Unit tests added - [ ] Integration tests added. - [ ] This change requires new documentation. - [ ] Documentation has been added/updated.
diff --git a/.github/workflows/bench-hyperfine.yml b/.github/workflows/bench-hyperfine.yml index b4f865d572..5e40934008 100644 --- a/.github/workflows/bench-hyperfine.yml +++ b/.github/workflows/bench-hyperfine.yml @@ -19,7 +19,8 @@ jobs: runs-on: ubuntu-latest env: CARGO_REGISTRIES_CRATES_IO_PROTOCOL:...
2
2
1
[{"id": "G0", "claim": "Dependency version specifiers added in Cargo.toml should be pinned to the full version (num-bigint \"0.4.4\" and test-case \"3.2.1\") rather than the partial \"0.4\" and \"3.2\".", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "clai...
null
starkware-libs__cairo_native__379
starkware-libs/cairo_native
379
defect
2e774cdac94488f719960cdf30595c8320835b61
812cc8fe288419784ef0c6b8066df45ecd3fd5a6
Dry pass manager
# Dry pass registration ## Description Dry this by creating a utility function where we have a single place that registers passes into a pass manager. The utils function is named `run_pass_manager`. ## Checklist - [x] `run_program` in `src/utils.rs` - [x] `run_native_program` in `tests/common.rs` - [x] `ma...
diff --git a/src/bin/cairo-native-compile.rs b/src/bin/cairo-native-compile.rs index cee8ac24c7..dfd4da6bf1 100644 --- a/src/bin/cairo-native-compile.rs +++ b/src/bin/cairo-native-compile.rs @@ -15,12 +15,12 @@ use cairo_lang_starknet::{ use cairo_native::{ debug_info::{DebugInfo, DebugLocations}, metadata::...
2
2
0
[{"id": "G0", "claim": "The run_pass_manager helper should return pass_manager.run(module) directly instead of wrapping it in Ok(...?).", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The compile binary should propagate the run_pass_manager error...
null
starkware-libs__cairo_native__877
starkware-libs/cairo_native
877
defect
3830367b994320556953f5d632a118b6261c03bf
8643c3e3cf73d0d35b2291cc3e07b3d1c647135a
cairo 2.9.0-dev (native v0.2.3 branch)
Fixes #879 This is cairo-native with cairo 2.9.0 features ## Checklist - [ ] Linked to Github Issue - [ ] Unit tests added - [ ] Integration tests added. - [ ] This change requires new documentation. - [ ] Documentation has been added/updated.
diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index afc85ace77..b8f26d7f1c 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -7,7 +7,7 @@ on: env: RANGE_SIZE: 25 - SEQUENCER_REV: 93b6da848802297626556950a0c715952aca552d + SEQUENCER_REV: 8d3e6b5515e7b62e7ab173...
4
3
0
[{"id": "G0", "claim": "The get_class_hash_at stub in examples/erc20.rs and examples/starknet.rs should panic with unimplemented!() instead of todo!() since the examples never invoke this syscall.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "T...
null
starkware-libs__sequencer__12443
starkware-libs/sequencer
12,443
defect
5915c87293a8fbd1ef9439560b60b47ecf25ae48
fc5aed1de83cadfd39cae40ee03ccba851fb48a0
starknet_patricia_storage: always cache writes in cached storage
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Medium Risk** > Changes `CachedStorage` behavior to always insert written keys into the LRU cache and removes the `cache_on_write` toggle, which can affect memory usage and performance characteristics in production deployments. > > **Overview** > **`CachedStorage` now always cache...
diff --git a/Cargo.lock b/Cargo.lock index 271b3d4c3c14..17daf15d979b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12107,6 +12107,7 @@ dependencies = [ "derive_more 2.1.1", "ethnum", "expect-test", + "futures", "hex", "pretty_assertions", "rand 0.8.5", diff --git a/crates/apollo_deployments/resources/app_co...
1
1
1
[{"id": "G0", "claim": "The call to `self.flush_to_cache(key_to_value)` in `mset` discards the returned `PatriciaStorageResult<()>` without propagating it with `?`, so if `flush_to_cache` ever returns an error, `mset` would silently swallow it and report success to the caller despite the cache being in an inconsistent ...
null
starkware-libs__sequencer__13097
starkware-libs/sequencer
13,097
defect
e3be9f1a0f3514e989f5b6d753022f6ef7bf5b1d
38cdcc178f37cd1d695f7ae93c9c4b193bcd7693
apollo_network: added end to end discovery test
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Low Risk** > Test-only changes (new CI/ignored e2e tests and `cfg(test)` visibility tweaks) with no impact on production networking behavior. > > **Overview** > Adds a new end-to-end discovery test (`e2e_discovery_test`) that spins up a bootstrap node plus N ephemeral peers, pre-s...
diff --git a/Cargo.lock b/Cargo.lock index 383805e21996..3b22c365d983 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2044,6 +2044,7 @@ dependencies = [ "apollo_config", "apollo_metrics", "apollo_network_types", + "apollo_propeller", "apollo_protobuf", "assert_matches", "async-stream", @@ -2062,6 +2063,8 @@ de...
20
20
3
[{"id": "G0", "claim": "Remove the M-dashes from the code comments in e2e_discovery_test.rs.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "When connection_receiver.recv() returns None the test exits with Ok and silently passes without verifying...
null
starkware-libs__sequencer__13152
starkware-libs/sequencer
13,152
defect
c494ba665f258a79106e2f76beb3d677c213baab
88a057389f6afa45aa8a8b682f71fb7633bb0162
starknet_os_flow_tests: fuzz test call/libcall bad entrypoint scenario
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Low Risk** > Changes are confined to test-only fuzz infrastructure and contract test fixtures, with no impact on production execution paths. Main risk is increased fuzz matrix/expectation drift causing flaky or failing CI in these integration tests. > > **Overview** > Adds two new...
diff --git a/Cargo.lock b/Cargo.lock index f13128118bf..d3589d0642d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12501,6 +12501,7 @@ dependencies = [ "assert_matches", "blockifier", "blockifier_test_utils", + "cairo-lang-runner", "cairo-lang-starknet-classes", "cairo-vm", "chrono", diff --git a/crates/block...
3
2
0
[{"id": "G0", "claim": "NON_EXISTING_ENTRY_POINT_MESSAGE is declared with const instead of static, so a fresh LazyLock is created at every use site, the initialization closure runs each time and caching never occurs, defeating the purpose of LazyLock.", "category": "performance", "verdict": "supported", "priority": "P2...
null
starkware-libs__sequencer__13155
starkware-libs/sequencer
13,155
defect
2e7ba5ffb588b6eea031e041561629f7411944b8
198d30e022359b7e1f6ad9d6d22d77a3327a18d9
starknet_os_flow_tests: fuzz test get block hash scenario
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Medium Risk** > Adds a new fuzz scenario that exercises `get_block_hash` syscall behavior and modifies block advancement/address expectations, which could make the fuzz harness more brittle if block-number assumptions change. > > **Overview** > Adds a new fuzz operation/scenario (...
diff --git a/crates/blockifier_test_utils/resources/feature_contracts/cairo0/compiled/fuzz_revert_compiled.json b/crates/blockifier_test_utils/resources/feature_contracts/cairo0/compiled/fuzz_revert_compiled.json index 31dfcdece2f..9b212578df4 100644 --- a/crates/blockifier_test_utils/resources/feature_contracts/cairo0...
1
1
0
[{"id": "G0", "claim": "The hand-rolled nested-loop search for unexpected errors could use a Cairo built-in membership construct (`in`/`contains`) instead of manually iterating over the two spans.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
starkware-libs__sequencer__13224
starkware-libs/sequencer
13,224
defect
e7a49d73695fb80bc46dae8b1d5ec41b70d055ac
e99c38382c64499f932f0a91a37202a89b533994
apollo_consensus: get voting weight from committee
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Medium Risk** > Changes core consensus quorum/round-skip calculations to optionally use stake-weighted voting, which can affect liveness/safety if committee weights or config are incorrect. Default remains unit-weight, reducing rollout risk but the new path is consensus-critical. >...
diff --git a/crates/apollo_consensus/src/manager.rs b/crates/apollo_consensus/src/manager.rs index 9270b056907..5d978ce45d1 100644 --- a/crates/apollo_consensus/src/manager.rs +++ b/crates/apollo_consensus/src/manager.rs @@ -607,6 +607,7 @@ impl<ContextT: ConsensusContext> MultiHeightManager<ContextT> { se...
8
8
4
[{"id": "G0", "claim": "The total voting weight should be kept in u128 rather than narrowing the committee's u128 weight sum into u64 with u64::try_from(sum).", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Vote weights should use u128 rather than u6...
null
starkware-libs__sequencer__13255
starkware-libs/sequencer
13,255
defect
5a00f10459e6aeb5ef0bb8f37adc78b5737636bb
eb2a4d5aec0e0157b6358770f3acc39ac6681474
apollo_propeller: track items dropped from engine TTL cache
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Low Risk** > Low risk: small API change confined to the in-crate `TimeCache` and a logging-only integration in the engine; behavior is otherwise unchanged aside from exposing which entries were lazily evicted. > > **Overview** > The TTL `TimeCache` now returns the list of keys evi...
diff --git a/crates/apollo_propeller/src/engine.rs b/crates/apollo_propeller/src/engine.rs index 4bfb648bd31..863414572ec 100644 --- a/crates/apollo_propeller/src/engine.rs +++ b/crates/apollo_propeller/src/engine.rs @@ -355,7 +355,12 @@ impl Engine { // Mark as finalized let message...
4
4
0
[{"id": "G0", "claim": "The comment '// Track the messages that have been removed from the TTL cache.' above the trace! call in engine.rs is redundant and can be dropped, at the author's discretion.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": ...
null
starkware-libs__sequencer__13264
starkware-libs/sequencer
13,264
defect
5a00f10459e6aeb5ef0bb8f37adc78b5737636bb
b702a5ce49cb19b0ff2784674d9b545687ad68db
apollo_propeller: add nonce per peer to prevent replays
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Medium Risk** > Changes message acceptance logic in `Engine::handle_unit` to reject units based on cached publisher nonces, which could inadvertently drop legitimate traffic if nonce handling/TTL interactions are wrong. > > **Overview** > **Replay protection:** the engine now main...
diff --git a/Cargo.lock b/Cargo.lock index 9201ab3d967..5cd1d9082b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2333,6 +2333,7 @@ dependencies = [ "asynchronous-codec", "futures", "libp2p", + "lru 0.12.5", "prost", "rand 0.8.5", "reed-solomon-simd", diff --git a/crates/apollo_propeller/Cargo.toml b/crates/...
18
16
4
[{"id": "G0", "claim": "The per-peer nonce is only advanced when a later finalization lazily evicts expired TTL-cache entries, so between a message's TTL expiry and the next eviction — which may never come if the peer goes idle — a replay can pass both the TTL-cache and the nonce checks.", "category": "security", "verd...
null
starkware-libs__sequencer__13282
starkware-libs/sequencer
13,282
defect
692ef24c7834d318e34d892961e1f5215bb313cd
436607ea4441b62d854a63327c6831d23e34f7ca
apollo_network: cancel stale DialPeerStreams when target peers are removed
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Medium Risk** > Changes discovery’s dialing lifecycle by actively cancelling in-flight/retrying dials when the target peer set shrinks, which can affect connectivity and retry behavior (including an explicitly documented edge-case with bootstrap peers). > > **Overview** > Discover...
diff --git a/crates/apollo_network/src/discovery/behaviours/bootstrapping/bootstrap_peer.rs b/crates/apollo_network/src/discovery/behaviours/bootstrapping/bootstrap_peer.rs deleted file mode 100644 index 8ddea59849a..00000000000 --- a/crates/apollo_network/src/discovery/behaviours/bootstrapping/bootstrap_peer.rs +++ /d...
4
4
1
[{"id": "G0", "claim": "In set_target_peers_cancels_dials_for_removed_peers the '// Poll — RequestDial is intercepted by Stream impl and forwarded to DialingBehaviour...' sentence is too low level; the paragraph should get a high-level title comment instead.", "category": "documentation", "verdict": "supported", "prior...
null
starkware-libs__sequencer__13285
starkware-libs/sequencer
13,285
defect
31effd7f8b0ac0c8f2fefed184b074574229081f
735455b9ca7eedefbf2fe5d4af68ec5b9c1a76cc
apollo_network: add peer access control behaviour to deny unauthorized inbound connections
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Medium Risk** > Adds new connection gating logic into the libp2p swarm, which can deny/close peer connections when enforcement is enabled and the allowed set changes. While enforcement defaults off, incorrect wiring of `set_allowed_peers` could inadvertently disconnect or block pee...
diff --git a/crates/apollo_network/src/discovery/behaviours/bootstrapping/bootstrap_peer.rs b/crates/apollo_network/src/discovery/behaviours/bootstrapping/bootstrap_peer.rs deleted file mode 100644 index 8ddea59849a3..000000000000 --- a/crates/apollo_network/src/discovery/behaviours/bootstrapping/bootstrap_peer.rs +++ ...
24
16
4
[{"id": "G0", "claim": "set_target_peers only appends newly-disallowed peers to pending_disconnections and never removes peers that have become allowed again, so a peer queued for disconnection by an earlier call is still disconnected even if a later call re-adds it to the allowed set.", "category": "correctness", "ver...
null
starkware-libs__sequencer__13342
starkware-libs/sequencer
13,342
defect
37307211f9866b1f250316b0dcf97514ec945a28
73b5589ff8807256bafe9de8478e3cacfbe7f708
apollo_batcher: add tests to preconfirmed block writer
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Low Risk** > Test-only additions plus `cfg(test)` derives/mocking; no production logic changes, so runtime behavior should be unaffected. > > **Overview** > Adds a new `pre_confirmed_block_writer_test` module that exercises `PreconfirmedBlockWriter` end-to-end with a mocked Cende ...
diff --git a/crates/apollo_batcher/src/cende_client_types.rs b/crates/apollo_batcher/src/cende_client_types.rs index 653fb7a9d7a..44010803b9e 100644 --- a/crates/apollo_batcher/src/cende_client_types.rs +++ b/crates/apollo_batcher/src/cende_client_types.rs @@ -542,7 +542,8 @@ impl From<ExecutableL1HandlerTransaction> f...
5
5
2
[{"id": "G0", "claim": "Debug is only needed in tests, so it should be derived under cfg_attr(test) instead of unconditionally, for all structs touched by this PR.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The channel-close test should exer...
null