diff --git a/src/core/DataType.test.ts b/src/core/DataType.test.ts deleted file mode 100644 index aebf98b..0000000 --- a/src/core/DataType.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { describe, it, expect } from 'vitest' -import { DataType, DATA_TYPE_INFO, getDataTypeInfo } from './DataType' - -describe('DataType', () => { - it('should have correct bit width for FP8', () => { - const info = getDataTypeInfo(DataType.FP8) - expect(info.bits).toBe(8) - expect(info.name).toBe('fp8') - expect(info.displayName).toBe('FP8') - }) - - it('should have correct bit width for FP16', () => { - const info = getDataTypeInfo(DataType.FP16) - expect(info.bits).toBe(16) - expect(info.name).toBe('fp16') - expect(info.displayName).toBe('FP16') - }) - - it('should have correct bit width for BF16', () => { - const info = getDataTypeInfo(DataType.BF16) - expect(info.bits).toBe(16) - expect(info.name).toBe('bf16') - expect(info.displayName).toBe('BF16') - }) - - it('should have correct bit width for FP32', () => { - const info = getDataTypeInfo(DataType.FP32) - expect(info.bits).toBe(32) - expect(info.name).toBe('fp32') - expect(info.displayName).toBe('FP32') - }) - - it('should have all data types in DATA_TYPE_INFO', () => { - expect(DATA_TYPE_INFO[DataType.FP8]).toBeDefined() - expect(DATA_TYPE_INFO[DataType.FP16]).toBeDefined() - expect(DATA_TYPE_INFO[DataType.BF16]).toBeDefined() - expect(DATA_TYPE_INFO[DataType.FP32]).toBeDefined() - }) -}) diff --git a/src/core/DataType.ts b/src/core/DataType.ts deleted file mode 100644 index 62878d6..0000000 --- a/src/core/DataType.ts +++ /dev/null @@ -1,23 +0,0 @@ -export enum DataType { - FP8 = 'fp8', - FP16 = 'fp16', - BF16 = 'bf16', - FP32 = 'fp32', -} - -export interface DataTypeInfo { - name: string - bits: number - displayName: string -} - -export const DATA_TYPE_INFO: Record = { - [DataType.FP8]: { name: 'fp8', bits: 8, displayName: 'FP8' }, - [DataType.FP16]: { name: 'fp16', bits: 16, displayName: 'FP16' }, - [DataType.BF16]: { name: 'bf16', bits: 16, displayName: 'BF16' }, - [DataType.FP32]: { name: 'fp32', bits: 32, displayName: 'FP32' }, -} - -export function getDataTypeInfo(dtype: DataType): DataTypeInfo { - return DATA_TYPE_INFO[dtype] -} diff --git a/src/layouts/BlockLayout.test.ts b/src/layouts/BlockLayout.test.ts index c3ec8c1..9cfe5ec 100644 --- a/src/layouts/BlockLayout.test.ts +++ b/src/layouts/BlockLayout.test.ts @@ -1,11 +1,22 @@ import { describe, it, expect } from 'vitest' import { identityStandardND, - calculateCoverage, createBlockLayout, getPositionsForThread, } from './BlockLayout' import { LinearLayout } from '../core/LinearLayout' +import type { BlockLayoutParams } from '../validation/InputValidator' + +/** + * Test helper: Calculate the coverage of a block layout + * Coverage = sizePerThread × threadsPerWarp × warpsPerCTA for each dimension + */ +function calculateCoverage(params: BlockLayoutParams) { + return { + height: params.sizePerThread[0] * params.threadsPerWarp[0] * params.warpsPerCTA[0], + width: params.sizePerThread[1] * params.threadsPerWarp[1] * params.warpsPerCTA[1], + } +} describe('BlockLayout', () => { describe('identityStandardND', () => { diff --git a/src/layouts/BlockLayout.ts b/src/layouts/BlockLayout.ts index 6fd1633..0cbf5d2 100644 --- a/src/layouts/BlockLayout.ts +++ b/src/layouts/BlockLayout.ts @@ -1,22 +1,6 @@ import { LinearLayout } from '../core/LinearLayout' import type { BlockLayoutParams } from '../validation/InputValidator' -export interface LayoutCoverage { - width: number - height: number -} - -/** - * Calculate the coverage of a block layout - * Coverage = sizePerThread × threadsPerWarp × warpsPerCTA for each dimension - */ -export function calculateCoverage(params: BlockLayoutParams): LayoutCoverage { - return { - height: params.sizePerThread[0] * params.threadsPerWarp[0] * params.warpsPerCTA[0], - width: params.sizePerThread[1] * params.threadsPerWarp[1] * params.warpsPerCTA[1], - } -} - /** * Create an N-dimensional identity layout with specified order * diff --git a/src/main.tabs.test.ts b/src/main.tabs.test.ts index 874ca80..58e0351 100644 --- a/src/main.tabs.test.ts +++ b/src/main.tabs.test.ts @@ -12,14 +12,11 @@ const mockParams: BlockLayoutParams = { const getParamsMock = vi.fn() const validateMock = vi.fn() const onSubmitMock = vi.fn() -const onInputMock = vi.fn() - vi.mock('./ui/ParameterForm', () => ({ ParameterForm: vi.fn().mockImplementation(() => ({ getParams: getParamsMock, validate: validateMock, onSubmit: onSubmitMock, - onInput: onInputMock, })), })) @@ -430,8 +427,6 @@ describe('main tab switching', () => { validateMock.mockReturnValue(true) onSubmitMock.mockReset() - onInputMock.mockReset() - projectionListeners.clear() tabActivationHandler = null subscribeMock.mockClear() diff --git a/src/tabs/BlockLayoutTab.test.ts b/src/tabs/BlockLayoutTab.test.ts index fbb0e70..4413312 100644 --- a/src/tabs/BlockLayoutTab.test.ts +++ b/src/tabs/BlockLayoutTab.test.ts @@ -9,7 +9,6 @@ type ParameterFormStub = { getParams: ReturnType validate: ReturnType onSubmit: ReturnType - onInput: ReturnType } const defaultParams: BlockLayoutParams = { @@ -38,7 +37,6 @@ vi.mock('../ui/ParameterForm', () => ({ getParams: vi.fn(() => currentParams), validate: vi.fn(() => validateResult), onSubmit: vi.fn(), - onInput: vi.fn(), } parameterFormInstances.push(instance) return instance diff --git a/src/ui/ParameterForm.ts b/src/ui/ParameterForm.ts index 3939f4c..4fca92e 100644 --- a/src/ui/ParameterForm.ts +++ b/src/ui/ParameterForm.ts @@ -128,16 +128,6 @@ export class ParameterForm { }) } - /** - * Add event listener for real-time validation - */ - onInput(callback: () => void): void { - this.form.addEventListener('input', () => { - this.validate() - callback() - }) - } - /** * Get number value from input */