Repository navigation
Fix qualified declarations and request helper compilation - #409
luisleo526 wants to merge 42 commits into
Conversation
Resolve dotted builtin signatures consistently and preserve explicit strings, chart-period fallback and single evaluation. Reserve generated conversion names.
The existing symbol-clock anchor tests now check both calls in the emitted empty-argument conditional. Add pure-Python checks of branch direction and single evaluation, and make the temporary-name sweep reach the argument lambda. Product code is unchanged by this test update.
Lower missing reference values to their destination storage and retain drawing handle types through user functions and tuple returns. Support declared polyline types, fields and deletion arguments.
Read optional function metadata safely when inferring reference casts, so bare emitters retain matrix element types without raising an AttributeError.
Use the established integer storage and matrix alias in type-flow assertions. Check array specializations, mutations, matrix values and copy independence.
Share operand and value inference while an expression query is active, then release cached results before bindings can change. Preserve ordinary matrix member initialization when the declaration expression is still available.
Use the chart period for a generic missing timeframe argument and refuse numeric values for string parameters during analysis. Cover named arguments, helper calls, source locations and generated translation units.
Include only the stock-generated PF-E2095 definition and pin. Preserve all prior catalog entry bytes and their existing order.
Merge the current main while retaining the feature correction.
Merge the current main while retaining the feature correction.
Merge the current main while retaining the feature correction.
Use recognized Pine types in declared type slots to resolve equally literal diagnostic templates. Keep stable code order for other ties and preserve qualifier identities, raw arguments and rendering. Pin the timeframe type diagnostic and its named arguments with direct regression controls.
Reject non-string timeframe arguments through the intrinsic signature before C++ lowering, including helper parameters and boolean values. Preserve valid string calls and exercise complete native controls at distinct optimization levels. Declare the new diagnostic in the existing catalog delta fixture.
Keep generated state and callable clone identities distinct from authored members and use the same allocated identities at declarations and calls. Preserve noncolliding names and duplicate-state assertions.
Carry the generated argument-type entry and its pin into the member while preserving all other catalog bytes and order. Use the grammatical message and exact approved user presentation with the existing argument kinds. Retain the same numeric refusal cases and qualifier controls.
Use the argument occurrence within the call instead of an identically named helper parameter. Keep the exact line and column assertions and all source inputs, diagnostic identities and test rows unchanged.
Carry registered namespace types through the semantic query used for written helper calls while respecting lexical shadowing and version boundaries. Reuse the existing expression-start locator for timeframe type refusals.
Allocate composed callable and persistent-storage identities outside reserved helper families, and reserve all authored spellings before sibling-block qualification. Keep declarations, calls and history consumers on the same allocated identity. Exercise collision cases through the public pipeline.
Keep raw typed-method names on the function channel when they collide with authored data members. Continue allocating encoded names and collisions with generated storage so method definitions, calls and state stay distinct.
Sizing constants keep their Pine string type for the string consumers this change fixes, so a reassigned sizing variable reaches the risk host boundary as a string and is converted to its integer code there. Keeping the integer comparison would need integer storage for these variables, which the string consumers cannot use. The test still requires the call to read t after its write, never its initializer, and now also checks the code chosen for the assigned value.
Keep the established admission policy for non-nullable script selections while retaining exact compound value joins inside functions and methods. This avoids introducing collection history for previously unresolved global selections.
Resolve the analyzer type-query conflict by retaining both lexical namespace typing and callable compound return profiles. Preserve the corrected script selection history admission and both changelog entries. No test expectation or additional product behavior is changed in this merge resolution.
Separate persistence from type qualifiers, retain mixed complete indentation levels, and preserve independently typed lower-timeframe tuple arrays. Keep helper bindings and tuple histories on the requested evaluator and omit unreachable forwarded TA instances. Add complete reported-case compilation regressions while preserving existing accepted controls.
Bring the branch up to date with main after #405 merged. No conflicts.
Use canonical allocated callable variants when selecting reached declarations. Keep visitor-rendered built-in tuple histories on their established chart series path with the matching warning, while preserving requested user tuples.
Keep direct tuple history diagnostics and chart-series fallback warnings while preserving requested tuple sampling within composed expressions.
Main's tree equals the base this branch was built on, so the merge keeps this branch's tree unchanged.
There was a problem hiding this comment.
Graphify reviewed this change.
Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.
Not checked: tests were not run; formal verification proved 0 of 18 changed function(s) (3 sampled, not proven, 15 not verified).
Formal verification. PR-changed functions: 3/18 verified (0 proven, 3 may-equivalent, 0 distinguished) · 15 not verified (1 vacuous, 14 unsupported).
Not verified on this run: \_visit\_TupleAssign (unsupported), \_handle\_request\_security\_lower\_tf (unsupported), \_\_init\_\_ (unsupported), \_build\_func\_instances (unsupported), \_generate\_cpp (unsupported), \_build\_security\_expr (unsupported), \_emit\_security\_evaluator\_body (unsupported), \_emit\_security\_evaluators (unsupported), \_emit\_security\_expr\_hist\_members (unsupported), \_security\_check\_tuple\_element\_history (unsupported), and 5 more.
Graphify review — findings
Adds tuple payloads to request.security_lower_tf, inline or helper-returned, producing one independently typed array per element, evaluated once per intrabar and cleared together. Tuple requests accept string and color elements that the scalar path rejects, while the refusal message still lists only float/int/bool. Also limits TA-buffer emission for forwarding helpers to variants reachable from executable statements (#372), samples global tuple declarations once per requested evaluator in declaration order, accepts a type qualifier after var/varip, and lets complete nested indentation levels mix tabs and spaces, with incomplete mixed prefixes keeping their earlier handling.
Worth a look
- Tuple lower-timeframe requests admit element types the runtime does not support —
pineforge_codegen/analyzer/call_handlers.py:1076· Escalate · medium- unverified hypothesis — survived the adversarial refute pass; needs human review
Review partial — this diff was larger than one review pass covers, so later files were not reviewed; some findings may be missing.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 5864 functions depend on the 1509 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
Parser— 227 callers, 42 callees - worse:
Analyzer— 115 callers, 15 callees - worse:
Lexer— 255 callers, 6 callees - new:
test_lower_timeframe_tuple_collection_types_are_per_element()— 0 callers, 10 callees
Verification — 5864 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 5035 function(s) in the blast radius were not formally verified this run
Cross-repo impact
Cross-repo impact
This change impacts 2 symbol(s) across 1 peer repo(s) — blast radius over derived cross-repo edges:
- pineforge-4pass/pineforge-hpo —
python/pineforge_hpo/transpile.py(via import_moniker, heuristic),tests/python/test_transpile.py(via import_moniker, heuristic)
1 peer repo(s) in this group are not yet indexed — cross-repo impact may be incomplete.
Cross-repo linkage is derived (SCIP-moniker matches are sound; name/contract matches are heuristic) and ADVISORY — it never affects this check's conclusion.
Test selection
Test selection
542 of 542 test file(s) selected (100%) via static blast radius.
Escalated to a full run for safety (
noncode-change,uncovered-code) — the selection is not trustworthy on its own (see below). CI should run the whole suite.
tests/test_action_pins.py— full-run-safetytests/test_allow_entry_in_qualifier.py— impact, full-run-safetytests/test_allow_entry_in_request_const.py— impact, full-run-safetytests/test_analyzer.py— impact, full-run-safetytests/test_analyzer_matrix_inference.py— impact, full-run-safetytests/test_analyzer_ta_return_types.py— impact, full-run-safetytests/test_anchor_tf_change.py— impact, full-run-safetytests/test_anchor_time.py— impact, full-run-safetytests/test_anchor_vwap.py— impact, full-run-safetytests/test_array_bounds_insert_fill_slice.py— impact, full-run-safetytests/test_array_checked_access.py— impact, full-run-safetytests/test_array_empty_aggregates.py— impact, full-run-safetytests/test_array_history.py— impact, full-run-safetytests/test_array_missing_integer_index.py— impact, full-run-safetytests/test_array_new_color_fill_and_na_size.py— impact, full-run-safetytests/test_array_new_defaults_and_order.py— impact, full-run-safetytests/test_array_reference_semantics.py— impact, full-run-safetytests/test_array_retained_alias.py— impact, full-run-safetytests/test_array_slice_view.py— impact, full-run-safetytests/test_array_sort_indices.py— impact, full-run-safetytests/test_array_terminal_returns.py— impact, full-run-safetytests/test_arrseg_coded_run_stops.py— impact, full-run-safetytests/test_arrseg_review_fixes.py— impact, full-run-safetytests/test_binop_operand_order.py— impact, full-run-safetytests/test_block_shadow_primitive_types.py— impact, full-run-safetytests/test_block_var_plain_siblings.py— impact, full-run-safetytests/test_bool_na_refusal.py— impact, full-run-safetytests/test_bool_na_refusals_2.py— impact, full-run-safetytests/test_bool_na_values.py— impact, full-run-safetytests/test_bool_string_inference.py— impact, full-run-safetytests/test_builtin_name_shadow.py— impact, full-run-safetytests/test_builtin_named_locals_compile.py— impact, full-run-safetytests/test_builtin_named_locals_price_refusal.py— impact, full-run-safetytests/test_builtin_named_locals_receipt.py— impact, full-run-safetytests/test_builtin_named_locals_scope.py— impact, full-run-safetytests/test_builtin_named_parameters.py— impact, full-run-safetytests/test_builtin_named_parameters_reference.py— impact, full-run-safetytests/test_calc_on_order_fills_codegen.py— impact, full-run-safetytests/test_calendar_lambda_locals.py— impact, full-run-safetytests/test_call_argument_order.py— impact, full-run-safetytests/test_callable_compound_type_flow.py— impact, full-run-safetytests/test_callable_local_histories.py— impact, full-run-safetytests/test_callable_series_param_types.py— impact, full-run-safetytests/test_callable_string_series_type.py— impact, full-run-safetytests/test_callable_ta_forwarded_length.py— impact, changed-test, full-run-safetytests/test_callable_var_first_reach.py— impact, full-run-safetytests/test_checked_settings.py— impact, full-run-safetytests/test_ci_engine_main_touched.py— full-run-safetytests/test_clone_name_allocation.py— impact, full-run-safetytests/test_closed_trade_fold.py— impact, full-run-safety- … and 492 more
non-code file(s) changed (
CHANGELOG.md,docs/reference/support-contracts.md) → running the full suite for safety (a code graph can't see config/fixture/data deps)
changed code file(s) with no mapped test (
CHANGELOG.md,docs/reference/support-contracts.md,pineforge_codegen/analyzer/call_handlers.py,pineforge_codegen/codegen/visit_stmt.py) — a coverage gap or a missing link — running the full suite rather than only the selected tests
Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.
Formal verification
Could not verify: Could not verify \_visit\_TupleAssign.
The verifier did not have enough to check \_visit\_TupleAssign, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: method — first parameter is `self`, which needs a constructed instance (not synthesizable)
Could not verify: Could not verify \_handle\_request\_security\_lower\_tf.
The verifier did not have enough to check \_handle\_request\_security\_lower\_tf, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: method — first parameter is `self`, which needs a constructed instance (not synthesizable)
Could not verify: Could not verify \_\_init\_\_.
The verifier did not have enough to check \_\_init\_\_, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: method — first parameter is `self`, which needs a constructed instance (not synthesizable)
Could not verify: Could not verify \_build\_func\_instances.
The verifier did not have enough to check \_build\_func\_instances, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: method — first parameter is `self`, which needs a constructed instance (not synthesizable)
Could not verify: Could not verify \_generate\_cpp.
The verifier did not have enough to check \_generate\_cpp, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: method — first parameter is `self`, which needs a constructed instance (not synthesizable)
Could not verify: Could not verify \_build\_security\_expr.
The verifier did not have enough to check \_build\_security\_expr, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: method — first parameter is `self`, which needs a constructed instance (not synthesizable)
No difference found (not proven): No behavior difference found in \_collect\_security\_expr\_hist\_subscripts (not a proof).
The verifier ran both versions of \_collect\_security\_expr\_hist\_subscripts on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.
Guarantee: Empirical: the synth_receiver tier. A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.
Note: An input the sampler did not try could still differ.
Could not verify: Could not verify \_emit\_security\_evaluator\_body.
The verifier did not have enough to check \_emit\_security\_evaluator\_body, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: method — first parameter is `self`, which needs a constructed instance (not synthesizable)
Could not verify: Could not verify \_emit\_security\_evaluators.
The verifier did not have enough to check \_emit\_security\_evaluators, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: method — first parameter is `self`, which needs a constructed instance (not synthesizable)
Could not verify: Could not verify \_emit\_security\_expr\_hist\_members.
The verifier did not have enough to check \_emit\_security\_expr\_hist\_members, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: method — first parameter is `self`, which needs a constructed instance (not synthesizable)
Could not verify: Could not verify \_security\_check\_tuple\_element\_history.
The verifier did not have enough to check \_security\_check\_tuple\_element\_history, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: method — first parameter is `self`, which needs a constructed instance (not synthesizable)
Could not verify: Could not verify \_security\_fallback\_owns.
The verifier did not have enough to check \_security\_fallback\_owns, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: method — first parameter is `self`, which needs a constructed instance (not synthesizable)
No difference found (not proven): No behavior difference found in \_security\_global\_history\_value (not a proof).
The verifier ran both versions of \_security\_global\_history\_value on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.
Guarantee: Empirical: the synth_receiver tier. A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.
Note: An input the sampler did not try could still differ.
Could not verify: Could not verify \_security\_global\_value\_inlinable.
The verifier did not have enough to check \_security\_global\_value\_inlinable, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: method — first parameter is `self`, which needs a constructed instance (not synthesizable)
Could not verify: Could not verify \_tuple\_binding\_cpp\_types.
The verifier did not have enough to check \_tuple\_binding\_cpp\_types, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: method — first parameter is `self`, which needs a constructed instance (not synthesizable)
Could not verify: Could not verify \_visit\_tuple\_assign.
The verifier did not have enough to check \_visit\_tuple\_assign, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: method — first parameter is `self`, which needs a constructed instance (not synthesizable)
No difference found (not proven): No behavior difference found in \_tokenize\_line (not a proof).
The verifier ran both versions of \_tokenize\_line on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.
Guarantee: Empirical: the synth_receiver tier. A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.
Note: An input the sampler did not try could still differ.
Could not verify: Could not verify \_parse\_var\_keyword\_decl.
The verifier did not have enough to check \_parse\_var\_keyword\_decl, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: not verifiable: all 3 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly __init__ raised on the synthesized receiver args — names the real obstacle, not a sampling gap)
· 1 grounded finding(s) anchored inline below; 3 more finding(s) on lines outside this diff (see the check run).
|
|
||
| @pytest.mark.parametrize("helper", [False, True], ids=["inline", "helper"]) | ||
| @pytest.mark.parametrize("named", [False, True], ids=["positional", "named"]) | ||
| def test_lower_timeframe_tuple_collection_types_are_per_element(helper, named): |
There was a problem hiding this comment.
test_lower_timeframe_tuple_collection_types_are_per_element()
fans out to 10 callees (efferent coupling).
Grounded coupling-delta finding (deterministic), not an LLM guess.
|
Closing in favor of #411, which carries this change unchanged as part of a combined pull request. |
Qualified declarations and request helper compilation (#372)
This change:
Uncalled forwarding helpers no longer allocate unresolved TA instances. The existing accepted controls remain covered.
It is rebuilt on the current main, so it keeps the callable clone naming from #350 and the compound value types from #391. Callable variants use their allocated names, and a bare tuple-element history payload keeps its refusal, while reads of the current element and reads inside builder expressions still compile.
Validation: the normal repository regressions in
tests/test_v6_declaration_request_compilation.pyreproduce 14 parser, code generation and C++ compilation failures on the earlier main, while 26 controls pass. With this change all 40 cases pass. The 11 affected test files, including #350's clone-name and security-payload tests, pass in full (246 cases). No test was changed.TradingView compiles the reported
var constdeclaration form without diagnostics.Supersedes #407.
Fixes #372