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
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/tweak-book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ body:
description: The dropdown stays in sync with the shelf automatically.
options:
# BOOKS:START (auto-generated by generator/sync-issue-books.mjs — do not edit by hand)
- "Bitonic Sorter · Ken Batcher's fixed wiring of comparators, and what a circuit of sums and relu pays to run it. — handwired-bitonic-sorter"
- "User Effort · A tiny circuit learns how long a click takes, then picks the faster layout — handwired-user-effort"
- "JSON Search · Can a GPU search a hundred thousand JSON documents faster, one thread each, with the lab's own weighted-sum program? — handwired-json-search"
- "Runtime Cost · What a CPU pays to run a handwired circuit: allocation, copying, and layers — handwired-runtime-cost"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Bitonic Sorter — chapter 1 story. Scene authored by Claude Opus 5.5 (claude-opus-5-5).
import type { Meta, StoryObj } from '@storybook/react-vite';
import { Player } from '../../core';
import { Render, vizScene } from './chapter-1';

/**
* Two Wires and a Fold — one comparator on two flat wires, Batcher's 24-comparator network as a ghost, then the
* wires stand up into the mountain [1, 2, 6, 7, 8, 5, 3, 0] and the half-cleaner folds it into a low and a high
* half; distance 2 and 1 finish the merge.
*/
function Chapter1() {
const scene = vizScene();
return (
<div style={{ padding: '4vh 4vw' }}>
<Player timeline={scene.tl} loop>
{(s) => <Render s={s} />}
</Player>
</div>
);
}

const meta: Meta<typeof Chapter1> = {
title: 'Books/Bitonic Sorter/Chapter 1',
component: Chapter1,
};
export default meta;

export const Scene: StoryObj<typeof Chapter1> = {};
951 changes: 951 additions & 0 deletions apps/bookshelf/src/viz/books/handwired-bitonic-sorter/chapter-1.tsx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Bitonic Sorter — chapter 2 story. Scene authored by Claude Opus 5.5 (claude-opus-5-5).
import type { Meta, StoryObj } from '@storybook/react-vite';
import { Player } from '../../core';
import { Render, vizScene } from './chapter-2';

/**
* Building the Mountains — eight discs ride an 8-wire bitonic network through its six stages: pairs set to climb
* or fall, two mountains of four, one mountain of eight, the half-cleaner, sorted; then the work count, the
* distance ribbon, a second input on the same wiring, and the zero-one and random checks.
*/
function Chapter2() {
const scene = vizScene();
return (
<div style={{ padding: '4vh 4vw' }}>
<Player timeline={scene.tl} loop>
{(s) => <Render s={s} />}
</Player>
</div>
);
}

const meta: Meta<typeof Chapter2> = {
title: 'Books/Bitonic Sorter/Chapter 2',
component: Chapter2,
};
export default meta;

export const Scene: StoryObj<typeof Chapter2> = {};
1,013 changes: 1,013 additions & 0 deletions apps/bookshelf/src/viz/books/handwired-bitonic-sorter/chapter-2.tsx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Bitonic Sorter — chapter 3 story. Scene authored by Claude Opus 5.5 (claude-opus-5-5) from the Sonnet 5.5 visual plan.
import type { Meta, StoryObj } from '@storybook/react-vite';
import { Player } from '../../core';
import { Render, vizScene } from './chapter-3';

/**
* The Staircase — one bitonic network grows from 8 to 64 wires beside a staircase of its stage counts
* (1, 3, 6, 10, 15, 21); a stage is n/2 comparators, the log axis shows the gap, a 64-wire sweep fires 32 at once,
* then +∞ padding, the article's off-by-one loop, and odd-even mergesort's 543 against 672.
*/
function Chapter3() {
const scene = vizScene();
return (
<div style={{ padding: '4vh 4vw' }}>
<Player timeline={scene.tl} loop>
{(s) => <Render s={s} />}
</Player>
</div>
);
}

const meta: Meta<typeof Chapter3> = {
title: 'Books/Bitonic Sorter/Chapter 3',
component: Chapter3,
};
export default meta;

export const Scene: StoryObj<typeof Chapter3> = {};
Loading
Loading