Baseline no watermark
{#if !$baselineCollapsed}
Mirroring stage {stage}: {stageLabel}
{#if $baseline.status === 'idle'}

Enter a prompt above and generate the baseline to begin.

{:else if $baseline.status === 'running'}

{$baseline.streamingText || 'generating…'}

{:else if $baseline.status === 'error'}

{$baseline.error}

{:else if result} {#if stage === 1}

Written once for this prompt and then left alone — the control the watermarked text on the right is measured against.

{result.text}

{:else if stage === 2} {#if method === 'ksemstamp'}

The baseline wrote every sentence in one pass. Nothing was embedded, judged or thrown away — the cost the watermark on the right is paying does not exist here.

    {#each result.text.split(/(?<=[.!?])\s+/).filter(Boolean) as s}
  1. kept{s}
  2. {/each}
{:else}

The unmodified distribution at step {stepIdx} — this is what the watermark on the right is transforming. Baseline sampling picked "{mirroredStep?.chosenTokenText ?? ''}" here.

{/if} {:else if stage === 3 || stage === 4} {#if method === 'kirchenbauer'}

The same secret applied to unwatermarked text. Green appears only at the rate chance allows.

{#if kirchDet}
{#each kirchDet.perUnit ?? [] as u} {u.label} {/each}
{#if greenSummary}
{greenSummary.green} of {greenSummary.total} scored tokens green ({((greenSummary.green / Math.max(1, greenSummary.total)) * 100).toFixed(0)}%, expected {Math.round($algoParams.kirchenbauer.gamma * 100)}%)
{/if} {:else}

scoring…

{/if} {:else if method === 'ksemstamp'}

Baseline sentences judged against the same valid regions.

{#if ksemDet}
    {#each ksemDet.perUnit ?? [] as u}
  1. {u.skipped ? 'seed' : u.green ? 'valid' : 'invalid'} {u.label}
  2. {/each}
{:else}

needs at least two sentences…

{/if} {:else if sealDet}

The same key over unwatermarked text: evidence stays flat.

{#each sealDet.perUnit ?? [] as u} {@const s = u.score ?? 0} {u.label} {/each}
{:else}

scoring…

{/if} {#if stage === 4}
{#each [['Kirchenbauer', kirchDet], ['k-SemStamp', ksemDet], ['TextSeal', sealDet]] as const as [label, d]}
{label}
{#if d}
{d.statistic.toFixed(2)}
{d.inconclusive ? 'inconclusive' : d.watermarked ? 'detected' : 'not detected'} {:else}
n/a
{/if}
{/each}
{/if} {/if} {#if stage === 2}
baseline text

{result.text}

{/if}
{result.tokenIds.length} tok · {(result.timings.totalMs / 1000).toFixed(1)}s · {result.timings.tokensPerSec.toFixed(1)} tok/s
{/if} {/if}