Context: Forge runs selected engines in browser Wasm workers, where inputs are attacker-controlled. Forge tracks this as VL-WASM-01.
Current behavior: Diff.hpp narrows sizes to int, computes combined sizes and retains frontier snapshots for backtracking; line_diff copies lines. No limit or cancellation contract appears in these APIs.
Need: checked arithmetic and limits before expensive allocation: input bytes/elements, trace memory, output size and work. Budget exhaustion must return an explicit incomplete/unavailable result, never a misleading complete diff.
Proposed API: DiffLimits, DiffFailure and diff_bounded/line_diff_bounded overloads, with cancellation checkpoints that do not require reflection or shared browser memory. Additive bounded APIs preserve existing callers.
Tests/gate: empty/equal inputs, unrelated sequences, repetitive lines, arithmetic boundaries, exhausted budgets, cancellation, reconstruction properties and native/Wasm agreement, with measured peak memory in the browser build. Forge gates M09 on this.
Context: Forge runs selected engines in browser Wasm workers, where inputs are attacker-controlled. Forge tracks this as VL-WASM-01.
Current behavior: Diff.hpp narrows sizes to int, computes combined sizes and retains frontier snapshots for backtracking; line_diff copies lines. No limit or cancellation contract appears in these APIs.
Need: checked arithmetic and limits before expensive allocation: input bytes/elements, trace memory, output size and work. Budget exhaustion must return an explicit incomplete/unavailable result, never a misleading complete diff.
Proposed API: DiffLimits, DiffFailure and diff_bounded/line_diff_bounded overloads, with cancellation checkpoints that do not require reflection or shared browser memory. Additive bounded APIs preserve existing callers.
Tests/gate: empty/equal inputs, unrelated sequences, repetitive lines, arithmetic boundaries, exhausted budgets, cancellation, reconstruction properties and native/Wasm agreement, with measured peak memory in the browser build. Forge gates M09 on this.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Context: Forge runs selected engines in browser Wasm workers, where inputs are attacker-controlled. Forge tracks this as VL-WASM-01.
Current behavior: Diff.hpp narrows sizes to int, computes combined sizes and retains frontier snapshots for backtracking; line_diff copies lines. No limit or cancellation contract appears in these APIs.
Need: checked arithmetic and limits before expensive allocation: input bytes/elements, trace memory, output size and work. Budget exhaustion must return an explicit incomplete/unavailable result, never a misleading complete diff.
Proposed API: DiffLimits, DiffFailure and diff_bounded/line_diff_bounded overloads, with cancellation checkpoints that do not require reflection or shared browser memory. Additive bounded APIs preserve existing callers.
Tests/gate: empty/equal inputs, unrelated sequences, repetitive lines, arithmetic boundaries, exhausted budgets, cancellation, reconstruction properties and native/Wasm agreement, with measured peak memory in the browser build. Forge gates M09 on this.
Implemented as bounded diff APIs on branch
issue-42-bounded-diff(commit4ad13ce), merged intomainasbe8dd73. Tests pass. Closing as done.