Skip to content

Dead fabrication stub: execute_function_step (engine.rs) is a pub fn with zero callers that zero-fills results — delete it #461

Description

@avrabe

Summary

StacklessEngine::execute_function_step (kiln-runtime/src/stackless/engine.rs:11524) is a dead pub fn with zero callers anywhere in the workspace (verified: grep execute_function_step outside its own definition matches nothing — not even tests). It is also a fabrication stub: it validates the function index, then returns zero-filled results without executing anything.

// Simulate step execution - in real implementation would execute instructions
// For now, return completed with default values
...
for result_type in &func_type.results {
    let default_value = match result_type {
        ValueType::I32 => Value::I32(0),
        ValueType::I64 => Value::I64(0),
        ...
        _ => Value::I32(0),
    };
    results.push(default_value)?;
}

This is the same fabrication family as SR-53 (#443, the arg-arity zero-fill, now fixed) and #412 — but for results, and unlike SR-53 it is currently not reachable (no live caller), so no user is receiving fake results from it today. That is the only reason this is low-severity rather than a correctness bug.

Why it should go

Two CLAUDE.md rules apply directly:

  • NO DEAD CODE — "If code is unused and has no clear immediate purpose → DELETE IT." A pub fn with zero callers, no test, and a // For now placeholder body qualifies.
  • Stub methods that return Ok(0)/Ok(()) without doing anything are BANNED — this returns zero-filled results as if it executed.

Leaving it is a latent trap: a future caller wiring up "step execution" would silently get fabricated results (✓ completed with all-zero outputs), exactly the class of bug SR-53/#412 were about — but with no arity signal to catch it.

Suggested fix

Delete execute_function_step (and any now-unused helpers it alone pulls in). If step-wise execution is genuinely planned, replace the body with Error::not_implemented_error(...) and add a tracking note — do not leave a stub that returns fabricated success.

Found by a fable subagent while fixing SR-53 (#443); reachability (zero callers) confirmed by grep on main (6e249068).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions