Rb to clear#136
Conversation
|
| Branch | rb-to-clear |
| Testbed | ubuntu-latest |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | leak-build-ms | Measure (units) x 1e3 | leak-count | Measure (units) | leak-run-ms | Measure (units) |
|---|---|---|---|---|---|---|
| benchmarks/concurrent/01_socket_throughput/bench | 📈 view plot | 5.14 units x 1e3 | 📈 view plot | 0.00 units | 📈 view plot | 6.68 units |
| benchmarks/concurrent/06_dynamic_spawn/bench | 📈 view plot | 5.11 units x 1e3 | 📈 view plot | 0.00 units | 📈 view plot | 40.08 units |
| benchmarks/concurrent/11_parallel_aggregation/bench | 📈 view plot | 5.23 units x 1e3 | 📈 view plot | 0.00 units | 📈 view plot | 13.01 units |
| benchmarks/concurrent/18_atomic_counter/bench | 📈 view plot | 5.19 units x 1e3 | 📈 view plot | 0.00 units | 📈 view plot | 5.13 units |
| benchmarks/inter-clear/04_concurrent_mvcc_fat_struct/bench | 📈 view plot | 5.31 units x 1e3 | 📈 view plot | 0.00 units | 📈 view plot | 193.50 units |
| benchmarks/sequential/03_alloc_throughput/bench | 📈 view plot | 5.00 units x 1e3 | 📈 view plot | 0.00 units | 📈 view plot | 17.30 units |
| benchmarks/sequential/08_sort/bench | 📈 view plot | 5.17 units x 1e3 | 📈 view plot | 0.00 units | 📈 view plot | 4.17 units |
| benchmarks/sequential/13_soa_layout/bench | 📈 view plot | 5.00 units x 1e3 | 📈 view plot | 0.00 units | 📈 view plot | 549.62 units |
Diff Coverage BucketsDiff base:
Src Ruby Visibility BreakdownScope: Files: 164 Counts are nonblank, non-comment Ruby source lines. Protected methods are grouped into
Zig Special Coverage AlertsNo added production Zig lines require missing Loom/VOPR/wait-loop coverage alerts. |
There was a problem hiding this comment.
SlopCop found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
| def initialize(source, raise_on_error: true) | ||
| @source = source | ||
| @raise_on_error = raise_on_error | ||
| @indent_level = 0 | ||
| @declared_locals = Set.new | ||
| @struct_fields = {} | ||
| @current_class = nil | ||
| @renames = {} | ||
| @mutable_params = nil | ||
| end |
| def with_renames(new_renames) | ||
| old_renames = @renames.dup | ||
| @renames.merge!(new_renames.compact) | ||
| yield | ||
| ensure | ||
| @renames = old_renames | ||
| end |
| def raise_unsupported(message, node) | ||
| loc = node.location | ||
| source_loc = "#{@source[0...loc.start_offset].count("\n") + 1}:#{loc.start_column}" | ||
| err_msg = "Unsupported Ruby syntax: #{message} at line #{source_loc}\nSource: #{loc.slice.strip}" | ||
|
|
||
| if @raise_on_error | ||
| raise TranspilationError, err_msg | ||
| else | ||
| "# [UNSUPPORTED: #{node.class.name.split('::').last}]\n# #{loc.slice.gsub("\n", "\n# ")}" | ||
| end | ||
| end |
| def with_indent | ||
| @indent_level += 1 | ||
| yield | ||
| ensure | ||
| @indent_level -= 1 | ||
| end |
| def visit_local_variable_and_write_node(node) | ||
| name = node.name.to_s | ||
| name = @renames[name] || name | ||
| val = visit(node.value) | ||
| if @declared_locals.include?(name) | ||
| "#{name} = (#{name} && #{val})" | ||
| else | ||
| @declared_locals << name | ||
| "MUTABLE #{name} = #{val}" | ||
| end | ||
| end |
| def visit_required_parameter_node(node) | ||
| prefix = (@mutable_params && @mutable_params.include?(node.name.to_s)) ? "MUTABLE " : "" | ||
| type = (@param_types && @param_types[node.name.to_s]) || "Auto" | ||
| "#{prefix}#{node.name}: #{type}" | ||
| end |
| def visit_optional_parameter_node(node) | ||
| prefix = (@mutable_params && @mutable_params.include?(node.name.to_s)) ? "MUTABLE " : "" | ||
| type = (@param_types && @param_types[node.name.to_s]) || "Auto" | ||
| default_val = visit(node.value) | ||
| "#{prefix}#{node.name} = #{default_val}: #{type}" | ||
| end |
| def visit_class_node(node) | ||
| old_class = @current_class | ||
| @current_class = node.constant_path.location.slice.strip | ||
|
|
||
| ivar_names = collect_instance_variables(node) | ||
| struct_fields = ivar_names.map { |name| " #{name}: Auto" }.join(",\n") | ||
| struct_code = "STRUCT #{@current_class} {\n#{struct_fields}\n}" | ||
|
|
||
| body_code = visit(node.body) | ||
|
|
||
| @current_class = old_class | ||
|
|
||
| "#{struct_code}\n\n#{body_code}" | ||
| end |
| end | ||
|
|
||
| def source | ||
| @binary_source ||= @source.b |
| class TranspilationError < StandardError; end | ||
|
|
||
| def initialize(source, raise_on_error: true) | ||
| @source = source |
|
|
||
| def initialize(source, raise_on_error: true) | ||
| @source = source | ||
| @raise_on_error = raise_on_error |
| def initialize(source, raise_on_error: true) | ||
| @source = source | ||
| @raise_on_error = raise_on_error | ||
| @indent_level = 0 |
| mocks.verify_partial_doubles = true | ||
| end | ||
|
|
||
| config.shared_context_metadata_behavior = :apply_to_host_groups |
|
|
||
| config.shared_context_metadata_behavior = :apply_to_host_groups | ||
| config.filter_run_when_matching :focus | ||
| config.example_status_persistence_file_path = "spec/examples.txt" |
| config.filter_run_when_matching :focus | ||
| config.example_status_persistence_file_path = "spec/examples.txt" | ||
| config.disable_monkey_patching! | ||
| config.warnings = true |
| config.warnings = true | ||
|
|
||
| if config.files_to_run.one? | ||
| config.default_formatter = "doc" |
| config.default_formatter = "doc" | ||
| end | ||
|
|
||
| config.order = :random |
| end | ||
|
|
||
| sig { params(spec_files: T.untyped).returns(T::Hash[T.untyped, T.untyped]) } | ||
| sig { params(spec_files: T.untyped).returns(T::Hash[Symbol, T::Hash[Symbol, T.untyped]]) } |
| # Public entry point. Parses each spec file once, memoises results. | ||
| # Returns a hash { CODE_SYM => { bad:, fix:, good:, file:, line: } }. | ||
| sig { returns(T.untyped) } | ||
| sig { returns(T::Hash[Symbol, T::Hash[Symbol, T.untyped]]) } |
| # { existing_kind:, given_kind:, first_site:, is_stdlib: } | ||
| # or nil when registration succeeded (or was a no-op re-use). | ||
| sig { params(type_sym: Symbol, kind_sym: Symbol, site_token: T.untyped).returns(T::Array[T.untyped]) } | ||
| sig { params(type_sym: Symbol, kind_sym: Symbol, site_token: T.nilable(T.any(Lexer::Token, Object))).returns([T::Boolean, T.nilable(T::Hash[Symbol, T.untyped])]) } |
| end | ||
|
|
||
| sig { params(node: AST::WithBlock, body_mir: T::Array[T.untyped], with_label: T.nilable(String)).returns(T::Array[T.untyped]) } | ||
| sig { params(node: AST::WithBlock, body_mir: T::Array[T.untyped], with_label: T.nilable(String)).returns(T::Array[MIR::Node]) } |
| end | ||
|
|
||
| it "scans string literals with escapes" do | ||
| idx, val = audit.send(:scan_string_literal, '"hello \\"world\\""', 0) |
| idx, val = audit.send(:scan_string_literal, '"hello \\"world\\""', 0) | ||
| expect(val).to eq('hello \\"world\\"') | ||
|
|
||
| idx, val = audit.send(:scan_string_literal, '"unclosed \\"', 0) |
There was a problem hiding this comment.
Espalier found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
|
|
||
| // Test Set | ||
| m.returns = vec!["Set".to_string()]; | ||
| m.return_elem_shapes = vec![json!({ "kind": "class", "name": "Float" })]; |
| assert_eq!(super::runtime_return_type_candidate(&m), "T::Hash[String, Integer]"); | ||
|
|
||
| // Test Set | ||
| m.returns = vec!["Set".to_string()]; |
| output_data = JSON.parse(File.read(temp_out.path)) | ||
| @store.actions.concat(output_data["actions"] || []) | ||
| if output_data["diagnostics"] | ||
| output_data["diagnostics"].each { |k, v| @store.diagnostics[k] = v } |
…egration tests Co-authored-by: gemini-cli <218195315+gemini-cli@users.noreply.github.com>
Co-authored-by: gemini-cli <218195315+gemini-cli@users.noreply.github.com>
…nspiling parser.rb with >95% node conversion Co-authored-by: gemini-cli <218195315+gemini-cli@users.noreply.github.com>
- Raise TranspilationError on regular expressions, rescue blocks, keyword arguments/parameters, and sub method calls. - Enforce block scoping inside function defs by pre-declaring reassigned variables at the top of the function. - Mark method parameters as MUTABLE in signatures if they are reassigned in the body. - Implement MultiWriteNode destructuring for array literal swaps. - Bubbles up unsupported expressions to statement level. - Fix string interpolation logic and nested block statement indentation. - Add exhaustive unit/integration specs covering all of these behaviors. Co-authored-by: gemini-cli <218195315+gemini-cli@users.noreply.github.com>
- Add desugaring/visitors for local/instance variable operator, or, and and write nodes (e.g. +=, ||=, etc.). - Add visitor support for OptionalParameterNode and update visit_parameters_node. - Add specs verifying these new transpilation features. Co-authored-by: gemini-cli <218195315+gemini-cli@users.noreply.github.com>
…y methods Ignore parameter list signature extraction fallback when a language behavior supports parameter normalization. Co-authored-by: gemini-cli <218195315+gemini-cli@users.noreply.github.com>
Inject 770+ verified type declarations to target files via nil-kill and auto-type bisection loops. Co-authored-by: gemini-cli <218195315+gemini-cli@users.noreply.github.com>
…m.transform Co-authored-by: gemini-cli <218195315+gemini-cli@users.noreply.github.com>
…s report Co-authored-by: gemini-cli <218195315+gemini-cli@users.noreply.github.com>
Co-authored-by: gemini-cli <218195315+gemini-cli@users.noreply.github.com>
- Fix signatures and redundant/incorrect T.must calls in src/ast/parser.rb, pipe_analysis.rb, and import_resolution.rb. - Fix missing nil-checks and block return types in liveness.rb and hoist.rb. - Prune redundant and duplicate top-level class definitions from ast-struct-fields.rbi that conflicted with T::Struct declarations. Co-authored-by: gemini-cli <218195315+gemini-cli@users.noreply.github.com>
Hook into T::Struct#initialize and T::Props::ClassMethods#prop/const to trace property initialization values and dynamic mutations of Sorbet struct properties, eliminating the NoEvidence gap for T::Struct subclasses. Co-authored-by: gemini-cli <218195315+gemini-cli@users.noreply.github.com>
Co-authored-by: gemini-cli <218195315+gemini-cli@users.noreply.github.com>
…g intermediate def Co-authored-by: gemini-cli <218195315+gemini-cli@users.noreply.github.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Rb to clear improv Co-authored-by: OpenAI Codex <codex@openai.com>
| temp_in.write(JSON.generate(input_data)) | ||
| temp_in.flush | ||
| bin_path = rust_binary_path | ||
| out, err, status = Open3.capture3(bin_path, temp_in.path, temp_out.path) |
| when "Symbol" then "String@symbol" | ||
| when "NilClass" then "Void" | ||
| when "Boolean" then "Bool" | ||
| when "TrueClass", "FalseClass" then "Bool" |
| elsif receiver_name == "T::Enumerable" || receiver_name == "Enumerable" | ||
| inner = convert_sorbet_type(node.arguments&.arguments&.first) | ||
| return "#{inner}[]" |
| @@ -1492,6 +1492,25 @@ | |||
| cause: "The value being assigned to an existing binding doesn't match the binding's declared type. Coercion was tried and failed.", | |||
| fix_hint: "Either change the value, change the declared type at the binding's declaration site, or use CAST for an explicit conversion.", | |||
| }, | |||
| DESTRUCTURE_REQUIRES_FIXED_SHAPE: { | |||
| @@ -1492,6 +1492,25 @@ | |||
| cause: "The value being assigned to an existing binding doesn't match the binding's declared type. Coercion was tried and failed.", | |||
| fix_hint: "Either change the value, change the declared type at the binding's declaration site, or use CAST for an explicit conversion.", | |||
| }, | |||
| DESTRUCTURE_REQUIRES_FIXED_SHAPE: { | |||
| severity: :error, category: :type, | |||
| template: "Destructuring assignment requires a fixed-size RHS, got %{got}", | |||
| cause: "`a, b = value` must know exactly how many slots `value` contains at compile time. Dynamic arrays, streams, and unknown call results cannot be destructured safely.", | ||
| fix_hint: "Use a fixed-size array or tuple-like value, or assign through explicit indexing after checking the shape.", | ||
| }, | ||
| DESTRUCTURE_ARITY_MISMATCH: { |
| }, | ||
| DESTRUCTURE_ARITY_MISMATCH: { | ||
| severity: :error, category: :type, | ||
| template: "Destructuring target count %{targets} does not match RHS size %{values}", |
| template: "Destructuring target count %{targets} does not match RHS size %{values}", | ||
| summary: "The number of destructuring targets must match the RHS fixed size.", | ||
| }, | ||
| DESTRUCTURE_REQUIRES_COPYABLE_RHS: { |
| }, | ||
| DESTRUCTURE_REQUIRES_COPYABLE_RHS: { | ||
| severity: :error, category: :type, | ||
| template: "Destructuring assignment currently requires a copyable RHS, got %{got}", |
| FsmStructure = Struct.new( | ||
| :captures, :state_fields, :steps, :finalize_cleanups, :ctx_id, | ||
| :result_aliases_finalized | ||
| ) do | ||
| extend T::Sig | ||
| include Emittable | ||
|
|
||
| sig { params(args: T.untyped).void } | ||
| def initialize(*args) |
| sig { params(stmt: LowerableStmt).returns(T::Boolean) } | ||
| def discard_expr_stmt?(stmt) | ||
| sig { params(stmt: LowerableStmt, mir: T.untyped).returns(T::Boolean) } | ||
| def discard_expr_stmt?(stmt, mir) |
Co-authored-by: OpenAI Codex <codex@openai.com>
| @@ -0,0 +1,186 @@ | |||
| require "spec_helper" | |||
| @@ -0,0 +1,36 @@ | |||
| mod actions; | |||
| @@ -0,0 +1,833 @@ | |||
| # frozen_string_literal: true | |||
| @@ -0,0 +1,1332 @@ | |||
| # frozen_string_literal: true | |||
| @@ -0,0 +1,999 @@ | |||
| # frozen_string_literal: true | |||
Co-authored-by: OpenAI Codex <codex@openai.com>
There was a problem hiding this comment.
Nil-Kill found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
No description provided.