Repository navigation
Conversation
PR Reviewer Guide 🔍(Review updated until commit bae8a97)Here are some key observations to aid the review process:
✅ Resolved findingsdocs/MODELS.md:413Stale documentation The built-in-models row for |
DeepSeek review: Not approved (
|
devnullexile
left a comment
There was a problem hiding this comment.
The overall BindCallable representation and solver composition are well structured, with solid test and eval coverage. Found three functional edge-case bugs (dereferenced stored args, &x/&obj.field stored args, and lambda-free projection for bound lambdas) plus one minor inspect dataflow classification gap.
| let binding = if let Some(n) = bind_placeholder(program, ctx, spelled) { | ||
| BoundArg::Placeholder(n) | ||
| } else if let Some(&(_, var)) = args.var_args.iter().find(|(at, _)| *at == position) { | ||
| BoundArg::Stored(var) |
There was a problem hiding this comment.
[P2] Dereferenced C++ arguments such as std::bind(Run, *slot) lose their load because lower_std_bind reads args.var_args before args.for_callee resolves args.deref_args. For Callback *slot, args.var_args still holds the raw pointer slot rather than the loaded *slot value, so BoundArg::Stored(slot) wires the pointer instead of the callback into Run's parameter and misses Run -> Target. Resolve any matching DerefArg entry (as CallArgs::for_callee does, using the target's reference_params or None when unknown) before storing the variable.
| call_site: cs.id, | ||
| arg_index: index, | ||
| actual_var, | ||
| actual_address: None, |
There was a problem hiding this comment.
[P2] Stored address-of arguments such as std::bind(&Worker::run, &worker) or std::bind(memset, &x, 0, sizeof(x)) drop addr_of_args and addr_of_member_args metadata when lowered into BoundArg::Stored(temp). At invocation, wire_bound_callable records actual_var: Some(temp) with actual_address: None (so arg_flow_edges reports the synthetic $ret temporary instead of worker/x), and compose_bound_site omits those positions from addr_of_args and addr_of_member_args (so Effect::Clears attaches its terminator to $ret, record_model_forwarded reports $ret, and Effect::Alias loses its member-address guard for &obj.field). Preserve address-of / member-address flags on stored arguments and resolve them via pag.argument_var / actual_address as append_argument_rows does.
| let kind_str = crate::inspect::loc_kind_schema_str(loc.kind); | ||
| let label = match (loc.kind, loc.var) { | ||
| (LocKind::Function, _) => format!("fn:{}", loc.desc), | ||
| (LocKind::Bound, _) => format!("bind:{}", loc.desc), |
There was a problem hiding this comment.
[P2] Exporting Bound locations with label bind:<desc> and kind Bound bypasses lambda sanitization in crates/trace-db/src/projection.rs (lines 713-727), which only matches label LIKE 'fn:%' and locations.kind = 'Function'. When std::bind wraps a lambda inside outer() (e.g. std::bind([](int) {}, 1)), the subsequent projection pass remaps the bound node's fn_id to outer and strips ::$lambda... from its label and description, corrupting the public flow_nodes and locations rows into claiming the binding wraps outer instead of anonymous callable with fn_id = NULL.
| LocKind::ArraySummary => "array_summary", | ||
| LocKind::Function => "function", | ||
| LocKind::StringLit => "string_lit", | ||
| LocKind::Bound => "bound", |
There was a problem hiding this comment.
[P3] crates/trace-db/src/dataflow.rs was not updated for the new "bound" flow_nodes.detail tag: lines 552 and 609 only match detail == "function". In trace inspect dataflow, a Bound location node therefore reads the NULL variable file/line columns instead of the target function's location (producing an empty path and line 0) and keeps kind = "loc" instead of "function" (unlike inspect/slice.rs:383), preventing lines 1544 and 1559 from rendering it as a function origin.
There was a problem hiding this comment.
Automated DeepSeek review found no blocking concerns in ff09cb9.
Represent each binding as a callable value carrying its target, receiver, stored arguments, and placeholder mapping through copies, fields, parameters, and returns. Compose the bindings at invocation for argument flow, callback discovery, and execution contexts. Reserve a slot for a model-supplied stop token. Use C++ lookup to identify standard bind and resolve explicitly cast targets. Preserve forwarded functions and lambdas as their targets resolve, and summarize a trailing argument pack across remaining formals. Register zero-argument model watchers when a callback variable acquires a bound value. Cover local brace initialization and globally qualified placeholders. Document packaged-task storage and external SDK dispatch. Apply ordinary dereference rules to stored arguments. Preserve explicit addresses and member-address fallback metadata for argument flow and function models. Retain bound lambda targets in raw exports and publish them as anonymous callables. Display named bound targets as function origins in dataflow inspection. Export provenance for each resolved target, including across configuration variants, and deduplicate identical captured and forwarded argument-flow rows. Validate with cargo test --workspace, 19 focused bind tests, and 51 canonical debug HiView and Camera checks. The expanded regression fixture produces matching one-job and eight-job exports. The earlier pinned comparison passed 199 default and 91 canonical checks across all four corpora, with matching exports at both job counts. Closes #243
Automated DeepSeek review of bae8a97 did not pass: merge recommendation is 'needs_review'; 1 finding(s) on lines changed since the last review.
Review prompts re-read the head commit right before posting, review newer commits first, and pass the reviewed head as commit_id. A force-push during a review left LHCWN/pathologist#302 reviewed on an outdated commit, so it returned as "new commits since your review". The previous texts stay in LEGACY_BUILTIN_PROMPTS so unedited saved copies upgrade. Review rows name who approved the PR and mark bots, from a new additive approvedBy field (each other reviewer's latest approval or change request). An older host keeps the generic "already approved by others" label.
devnullexile
left a comment
There was a problem hiding this comment.
All four earlier comments are resolved in bae8a97 (dereferenced target/argument loads, stored address-of and member-address metadata, lambda-free projection for Bound locations, and dataflow.rs handling of detail == "bound"), with focused regression tests for each. No new issues found in the changes since 5603ae7.
Represent each concrete binding as a callable value carrying its target, receiver, stored arguments, and placeholder mapping through copies, fields, parameters, and returns. Compose those bindings at invocation and use the same arguments for model wiring, callback discovery, and execution contexts. Reserve a slot for a model-supplied stop token.
Use C++ lookup to identify standard bind and resolve explicitly cast targets. Carry results through brace initialization and recognize globally qualified placeholders without the standard declaration. Keep runtime and ambiguous targets opaque. Document packaged-task storage and external SDK dispatch as separate gaps.
Export provenance for each binding across configuration variants and deduplicate identical captured and forwarded argument-flow rows.
Validate with cargo test --workspace, 13 focused bind tests, 198 default and 90 canonical pinned-corpus checks, and matching one-job and eight-job regression exports. Canonical debug HiView and Camera passed 50 checks.
Closes #243