Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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: 1 addition & 1 deletion apps/web/e2e/integration-smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ test.describe("Sprint 36 — Integration Smoke Test", () => {
timeout: 5000,
});

// r9 should be 102 (0x66) — proving editing ω7 changed the downstream result
// r9 should be 102 (0x66) — proving editing φ7 changed the downstream result
const regHex9 = page.getByTestId("register-hex-9");
await expect(regHex9).toHaveText(/0x0{14}66/i, { timeout: 5000 });
});
Expand Down
14 changes: 7 additions & 7 deletions apps/web/e2e/sprint-03-instructions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ test.describe("Sprint 03 — Flat Instruction List", () => {
await expect(mnemonicElement).toHaveText(/.+/);
});

test("register arguments use omega notation (ω)", async ({ page }) => {
test("register arguments use phi notation (φ)", async ({ page }) => {
// Load the add-jam example (SPI, in wat category — collapsed by default)
await page.goto("/#/load");
await page.getByTestId("category-toggle-wat").click();
Expand All @@ -69,21 +69,21 @@ test.describe("Sprint 03 — Flat Instruction List", () => {
const panel = page.getByTestId("instructions-panel");
await expect(panel).toBeVisible();

// At least one instruction should contain omega notation
// At least one instruction should contain phi notation
const argsElements = panel.getByTestId("instruction-args");
const count = await argsElements.count();
expect(count).toBeGreaterThan(0);

// Find at least one args element with omega notation
let foundOmega = false;
// Find at least one args element with phi notation
let foundPhi = false;
for (let i = 0; i < count; i++) {
const text = await argsElements.nth(i).textContent();
if (text?.includes("ω")) {
foundOmega = true;
if (text?.includes("φ")) {
foundPhi = true;
break;
}
}
expect(foundOmega).toBe(true);
expect(foundPhi).toBe(true);
});

test("current PC row is visually highlighted", async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions apps/web/e2e/sprint-04-registers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test.describe("Sprint 04 — Registers + Status Display", () => {
await expect(gasValue).toHaveText(/^[\d,]+$/);
});

test("all 13 register rows render with omega labels", async ({ page }) => {
test("all 13 register rows render with phi labels", async ({ page }) => {
await loadProgram(page);

const panel = page.getByTestId("registers-panel");
Expand All @@ -52,7 +52,7 @@ test.describe("Sprint 04 — Registers + Status Display", () => {
await expect(row).toBeVisible();

const label = page.getByTestId(`register-label-${i}`);
await expect(label).toHaveText(`ω${i}:`);
await expect(label).toHaveText(`φ${i}:`);
}
});

Expand Down
26 changes: 13 additions & 13 deletions apps/web/e2e/sprint-28-asm-raw-popover.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function loadProgram(
}

test.describe("Sprint 28 — ASM/Raw Toggle + Binary Popover", () => {
test("ASM mode shows omega notation", async ({ page }) => {
test("ASM mode shows phi notation", async ({ page }) => {
await loadProgram(page, "add-jam");

const panel = page.getByTestId("instructions-panel");
Expand All @@ -40,21 +40,21 @@ test.describe("Sprint 28 — ASM/Raw Toggle + Binary Popover", () => {
const asmBtn = page.getByTestId("display-mode-asm");
await expect(asmBtn).toBeVisible();

// Instruction args should contain omega notation
// Instruction args should contain phi notation
const argsElements = panel.locator("[data-testid='instruction-args']");
const count = await argsElements.count();
expect(count).toBeGreaterThan(0);

// At least one arg should contain omega (ω) character
let hasOmega = false;
// At least one arg should contain phi (φ) character
let hasPhi = false;
for (let i = 0; i < count; i++) {
const text = await argsElements.nth(i).textContent();
if (text?.includes("ω")) {
hasOmega = true;
if (text?.includes("φ")) {
hasPhi = true;
break;
}
}
expect(hasOmega).toBe(true);
expect(hasPhi).toBe(true);
});

test("toggling to Raw mode changes displayed text", async ({ page }) => {
Expand Down Expand Up @@ -87,7 +87,7 @@ test.describe("Sprint 28 — ASM/Raw Toggle + Binary Popover", () => {
expect(firstRaw).toMatch(/^[0-9A-F]{2}( [0-9A-F]{2})*$/);
});

test("toggling back to ASM restores omega notation", async ({ page }) => {
test("toggling back to ASM restores phi notation", async ({ page }) => {
await loadProgram(page, "add-jam");

const panel = page.getByTestId("instructions-panel");
Expand All @@ -106,18 +106,18 @@ test.describe("Sprint 28 — ASM/Raw Toggle + Binary Popover", () => {
const mnemonics = panel.locator("[data-testid='instruction-mnemonic']");
expect(await mnemonics.count()).toBeGreaterThan(0);

// Omega notation should be present in args
// Phi notation should be present in args
const argsElements = panel.locator("[data-testid='instruction-args']");
const count = await argsElements.count();
let hasOmega = false;
let hasPhi = false;
for (let i = 0; i < count; i++) {
const text = await argsElements.nth(i).textContent();
if (text?.includes("ω")) {
hasOmega = true;
if (text?.includes("φ")) {
hasPhi = true;
break;
}
}
expect(hasOmega).toBe(true);
expect(hasPhi).toBe(true);
});

test("clicking an instruction opens the binary popover", async ({ page }) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/debugger/RegisterRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function RegisterRow({
data-testid={`register-label-${index}`}
className="text-muted-foreground w-8 shrink-0 select-none"
>
ω{index}:
φ{index}:
</span>
{editing ? (
<input
Expand Down
10 changes: 5 additions & 5 deletions apps/web/src/components/debugger/RegistersPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ describe("RegistersPanel — Change Highlighting", () => {
/>,
);

// omega3 changed -> should have delta
// phi3 changed -> should have delta
expect(screen.getByTestId("register-delta-3")).toBeDefined();
// omega0 did not change -> no delta
// phi0 did not change -> no delta
expect(screen.queryByTestId("register-delta-0")).toBeNull();
// PC changed -> delta
expect(screen.getByTestId("pc-delta")).toBeDefined();
Expand All @@ -133,7 +133,7 @@ describe("RegistersPanel — Change Highlighting", () => {
/>,
);

// Step 1->2: omega5 changes
// Step 1->2: phi5 changes
rerender(
<RegistersPanel
snapshot={snap2}
Expand Down Expand Up @@ -269,9 +269,9 @@ describe("RegistersPanel — Multi-PVM Divergence", () => {
/>,
);

// omega7 differs -> divergence indicator
// phi7 differs -> divergence indicator
expect(screen.getByTestId("register-divergence-7")).toBeDefined();
// omega0 matches -> no indicator
// phi0 matches -> no indicator
expect(screen.queryByTestId("register-divergence-0")).toBeNull();
});
});
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/components/drawer/HostCallTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function Sidebar({
data-testid="output-preview"
className="text-xs font-mono border-t border-border pt-1"
>
<span className="text-muted-foreground">ω₇ ← </span>
<span className="text-muted-foreground">φ₇ ← </span>
<span className="text-foreground">
{outputValue.toString()}
{outputValue !== NONE && (
Expand Down Expand Up @@ -305,7 +305,7 @@ export function HostCallTab({
setNoneChecked(checked);
setUserModified(true);
if (checked) {
// NONE: ω₇ = 2^64-1, no memory writes, clean up previously applied mem writes
// NONE: φ₇ = 2^64-1, no memory writes, clean up previously applied mem writes
for (const addr of appliedMemAddrsRef.current) {
pendingChanges.removeMemoryWrite(addr);
}
Expand Down Expand Up @@ -394,7 +394,7 @@ export function HostCallTab({
)}
{noneChecked && (
<p className="text-xs text-muted-foreground italic">
NONE mode: returning ω₇ = 2⁶⁴−1 with no memory writes.
NONE mode: returning φ₇ = 2⁶⁴−1 with no memory writes.
</p>
)}
<p
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/drawer/hostcalls/GasHostCall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function GasHostCall({ info, onEffectsReady }: GasHostCallProps) {

const stableOnEffects = useStableCallback(onEffectsReady);

// Auto-report ω₇ = currentGas on mount
// Auto-report φ₇ = currentGas on mount
useEffect(() => {
stableOnEffects({
registerWrites: new Map([[7, currentGas]]),
Expand All @@ -25,7 +25,7 @@ export function GasHostCall({ info, onEffectsReady }: GasHostCallProps) {
return (
<div data-testid="gas-host-call" className="flex flex-col gap-2 text-xs">
<p className="text-muted-foreground">
Returns current gas counter in ω₇.
Returns current gas counter in φ₇.
</p>
<div className="font-mono">
<span className="text-muted-foreground">Current gas: </span>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/drawer/hostcalls/LogHostCall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function toHexString(data: Uint8Array): string {
/**
* Log host call view (index 100).
*
* Log registers: ω7=level, ω8=target_ptr, ω9=target_len, ω10=msg_ptr, ω11=msg_len
* Log registers: φ7=level, φ8=target_ptr, φ9=target_len, φ10=msg_ptr, φ11=msg_len
*
* Decodes message text from trace memory reads (resumeProposal.memoryWrites)
* when available, otherwise reads memory from the orchestrator using the
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/drawer/hostcalls/StorageHostCall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export function StorageHostCall({
const isRead = info.hostCallIndex === 3;
const regs = info.currentState.registers;

// For read: ω7=serviceId, ω8=keyPtr, ω9=keyLen, ω10=dest, ω11=offset, ω12=maxLen
// For read: φ7=serviceId, φ8=keyPtr, φ9=keyLen, φ10=dest, φ11=offset, φ12=maxLen
const serviceId = regs[7] ?? 0n;
const keyPtr = Number(regs[8] ?? 0n);
const keyLen = Number(regs[9] ?? 0n);
Expand All @@ -271,7 +271,7 @@ export function StorageHostCall({
// Only seed if key doesn't already exist (don't overwrite user edits)
if (!storageTable.store.get(fullKey)) {
// The trace's memory write at destAddr is the sliced value; we need to reconstruct the full value.
// The ω₇ return value from the proposal is the full value length.
// The φ₇ return value from the proposal is the full value length.
const _fullLen = Number(proposal.registerWrites.get(7) ?? 0n);
// For simplicity, seed the sliced portion — this is what the trace knows about.
const mw = proposal.memoryWrites.find((w) => w.address === destAddr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface RegisterMeta {
format: RegisterFormat;
}

/** Metadata for the output register (typically ω₇). */
/** Metadata for the output register (typically φ₇). */
export interface OutputRegisterMeta {
index: number;
label: string;
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/components/drawer/trace-display.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe("formatEntryLines", () => {
it("formats header line with ecalli index and gas", () => {
const entry = makeEntry({ index: 2, gas: 999n });
const lines = formatEntryLines(entry);
expect(lines[0]).toBe("ecalli 2, ω7 = 999");
expect(lines[0]).toBe("ecalli 2, φ7 = 999");
});

it("formats memory reads", () => {
Expand All @@ -106,7 +106,7 @@ describe("formatEntryLines", () => {
registerWrites: new Map([[7, 42n]]),
});
const lines = formatEntryLines(entry);
expect(lines).toContainEqual(" ω7 ← 42");
expect(lines).toContainEqual(" φ7 ← 42");
});

it("formats gas update when gasAfter is present", () => {
Expand Down Expand Up @@ -134,7 +134,7 @@ describe("formatEntryLines", () => {
const entry = makeEntry({ index: 0, gas: 100n });
const lines = formatEntryLines(entry);
expect(lines).toHaveLength(1);
expect(lines[0]).toBe("ecalli 0, ω7 = 100");
expect(lines[0]).toBe("ecalli 0, φ7 = 100");
});
});

Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/drawer/trace-display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function formatEntryLines(entry: TraceEntry): string[] {
const name = getHostCallName(entry.index);
const lines: string[] = [];

lines.push(`ecalli ${entry.index}, ω7 = ${entry.gas}`);
lines.push(`ecalli ${entry.index}, φ7 = ${entry.gas}`);

// Memory reads
for (const mr of entry.memoryReads) {
Expand All @@ -66,7 +66,7 @@ export function formatEntryLines(entry: TraceEntry): string[] {

// Register writes
for (const [reg, val] of entry.registerWrites) {
lines.push(` ω${reg} ← ${val}`);
lines.push(` φ${reg} ← ${val}`);
}

// Gas update
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/hooks/useDebuggerActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export function persistWriteToStorage(
const keyHex = deriveKeyHex(hc);
if (!keyHex) return;

// For write, value is at ω9/ω10
// For write, value is at φ9/φ10
const valPtr = Number(hc.currentState.registers[9] ?? 0n);
const valLen = Number(hc.currentState.registers[10] ?? 0n);

Expand Down
12 changes: 6 additions & 6 deletions apps/web/src/hooks/useDisassembly.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe("useDisassembly", () => {
expect(result.current).toEqual([]);
});

it("args use omega notation, rawArgs use numeric indices", () => {
it("args use phi notation, rawArgs use numeric indices", () => {
const bytes = new Uint8Array(
readFileSync(resolve(fixturesDir, "generic/add.pvm")),
);
Expand All @@ -39,14 +39,14 @@ describe("useDisassembly", () => {
expect(instructions.length).toBeGreaterThan(0);

// Find instructions that have register arguments
const withRegArgs = instructions.filter((i) => i.args.includes("ω"));
const withRegArgs = instructions.filter((i) => i.args.includes("φ"));
expect(withRegArgs.length).toBeGreaterThan(0);

for (const instr of withRegArgs) {
// ASM args should contain omega
expect(instr.args).toMatch(/ω\d+/);
// Raw args should NOT contain omega, should contain plain numbers
expect(instr.rawArgs).not.toContain("ω");
// ASM args should contain phi
expect(instr.args).toMatch(/φ\d+/);
// Raw args should NOT contain phi, should contain plain numbers
expect(instr.rawArgs).not.toContain("φ");
// Raw args should be non-empty (they have register operands)
expect(instr.rawArgs.length).toBeGreaterThan(0);
}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/hooks/useDisassembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ export interface DecodedInstruction {
mnemonic: string;
rawBytes: Uint8Array;
args: string;
/** Numeric-only argument string (register indices as numbers, no omega notation). */
/** Numeric-only argument string (register indices as numbers, no phi notation). */
rawArgs: string;
/** Index of the basic block this instruction belongs to (0-based). */
blockIndex: number;
}

function regName(index: number): string {
return `ω${index}`;
return `φ${index}`;
}

function formatImm(decoder: { getI32(): number }): string {
Expand Down
12 changes: 6 additions & 6 deletions apps/web/src/hooks/useDivergenceCheck.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ describe("useDivergenceCheck", () => {
useDivergenceCheck(snapshots, "typeberry", 0),
);
expect(result.current.summary).toBe("2 registers");
expect(result.current.details).toContain("ω3:");
expect(result.current.details).toContain("ω7:");
expect(result.current.details).toContain("φ3:");
expect(result.current.details).toContain("φ7:");
});

it("shows 1 register for single register divergence", () => {
Expand Down Expand Up @@ -186,7 +186,7 @@ describe("useDivergenceCheck", () => {
);

// PC diverges (typeberry vs polkavm), Gas diverges (typeberry vs ananas),
// register ω3 diverges (typeberry vs both)
// register φ3 diverges (typeberry vs both)
expect(result.current.summary).toBe("PC, Gas, 1 register");

// Details should have entries for each diverging PVM
Expand All @@ -196,9 +196,9 @@ describe("useDivergenceCheck", () => {
// Gas diverges only with ananas, PC only with polkavm
expect(details).toContain("Gas:");
expect(details).toContain("PC:");
// ω3 diverges with both
const omega3Lines = details.split("\n").filter((l) => l.startsWith("ω3:"));
expect(omega3Lines.length).toBe(2);
// φ3 diverges with both
const phi3Lines = details.split("\n").filter((l) => l.startsWith("φ3:"));
expect(phi3Lines.length).toBe(2);
});

it("reports divergence from perspective of selected PVM", () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/hooks/useDivergenceCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function useDivergenceCheck(
if (selected.registers[i] !== other.registers[i]) {
divergentRegIndices.add(i);
detailLines.push(
`\u03C9${i}: ${selectedPvmId}=0x${BigInt.asUintN(64, selected.registers[i]).toString(16)}, ${pvmId}=0x${BigInt.asUintN(64, other.registers[i]).toString(16)}`,
`\u03C6${i}: ${selectedPvmId}=0x${BigInt.asUintN(64, selected.registers[i]).toString(16)}, ${pvmId}=0x${BigInt.asUintN(64, other.registers[i]).toString(16)}`,
);
}
}
Expand Down
Loading
Loading