Skip to content

Fix double-multiplication bug in oracle_sparsify cache stats printing#802

Merged
msoos merged 2 commits intoworking-on-synthfrom
copilot/sub-pr-801
Mar 11, 2026
Merged

Fix double-multiplication bug in oracle_sparsify cache stats printing#802
msoos merged 2 commits intoworking-on-synthfrom
copilot/sub-pr-801

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 11, 2026

The local safe_div lambda in oracle_sparsify already multiplied by 100.0 to produce a percentage, but the call site multiplied by 100.0 again—displaying cache usefulness as ~10000% instead of ~100%.

// Before: local lambda multiplies by 100, caller multiplies by 100 again
auto safe_div = [](uint32_t a, uint32_t b) {
    if (b == 0) return 0.0;
    return (double)a/(double)b*100.0;  // already a percentage
};
// ...
<< safe_div(...)*100.0 << "%"  // 100x too large
  • Removed the redundant local safe_div lambda; now uses the global safe_div from constants.h (which returns a plain ratio), consistent with how oracle_vivif already does it

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Update synth functionality Fix double-multiplication bug in oracle_sparsify cache stats printing Mar 11, 2026
@msoos msoos marked this pull request as ready for review March 11, 2026 20:37
@msoos msoos merged commit de7e50b into working-on-synth Mar 11, 2026
@msoos msoos deleted the copilot/sub-pr-801 branch March 11, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants