Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Brillig opcode diff report for programs #5

Merged
merged 7 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"version": "0.2",
"words": [
"ACIR",
"Brillig",
"Brilligs",
"Quantile"
]
}
264 changes: 219 additions & 45 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/format/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const selectSummaryDiffs = (
functions: functions.filter(
(method) =>
Math.abs(method.circuit_size.percentage) >= minCircuitChangePercentage &&
(method.acir_opcodes.delta !== 0 || method.circuit_size.delta !== 0)
(method.opcodes.delta !== 0 || method.circuit_size.delta !== 0)
),
}))
.filter((diff) => diff.functions.length > 0);
Expand Down Expand Up @@ -109,7 +109,7 @@ export const formatShellDiff = (diffs: ContractDiffReport[], summaryQuantile = 0
"",
colors.bold(colors.grey((methodIndex === 0 ? diff.name : "").padEnd(maxContractLength))),
colors.italic(method.name.padEnd(maxMethodLength)),
...formatShellCell(method.acir_opcodes),
...formatShellCell(method.opcodes),
...formatShellCell(method.circuit_size),
"",
]
Expand All @@ -127,7 +127,7 @@ export const formatShellDiff = (diffs: ContractDiffReport[], summaryQuantile = 0
"",
colors.bold(colors.grey((methodIndex === 0 ? diff.name : "").padEnd(maxContractLength))),
colors.italic(method.name.padEnd(maxMethodLength)),
...formatShellCell(method.acir_opcodes),
...formatShellCell(method.opcodes),
...formatShellCell(method.circuit_size),
"",
]
Expand Down Expand Up @@ -261,7 +261,7 @@ export const formatMarkdownDiff = (
"",
`**${diff.name}**`,
diff.functions.map((method) => `_${method.name}_`).join("<br />"),
...formatMarkdownSummaryCell(diff.functions.map((method) => method.acir_opcodes)),
...formatMarkdownSummaryCell(diff.functions.map((method) => method.opcodes)),
...formatMarkdownSummaryCell(diff.functions.map((method) => method.circuit_size)),
"",
]
Expand All @@ -274,7 +274,7 @@ export const formatMarkdownDiff = (
"",
`**${diff.name}**`,
diff.functions.map((method) => `_${method.name}_`).join("<br />"),
...formatMarkdownFullCell(diff.functions.map((method) => method.acir_opcodes)),
...formatMarkdownFullCell(diff.functions.map((method) => method.opcodes)),
...formatMarkdownFullCell(diff.functions.map((method) => method.circuit_size)),
"",
]
Expand Down
Loading
Loading