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
39 changes: 0 additions & 39 deletions src/core/DataType.test.ts

This file was deleted.

23 changes: 0 additions & 23 deletions src/core/DataType.ts

This file was deleted.

13 changes: 12 additions & 1 deletion src/layouts/BlockLayout.test.ts
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down
16 changes: 0 additions & 16 deletions src/layouts/BlockLayout.ts
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down
5 changes: 0 additions & 5 deletions src/main.tabs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})),
}))

Expand Down Expand Up @@ -430,8 +427,6 @@ describe('main tab switching', () => {
validateMock.mockReturnValue(true)

onSubmitMock.mockReset()
onInputMock.mockReset()

projectionListeners.clear()
tabActivationHandler = null
subscribeMock.mockClear()
Expand Down
2 changes: 0 additions & 2 deletions src/tabs/BlockLayoutTab.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ type ParameterFormStub = {
getParams: ReturnType<typeof vi.fn>
validate: ReturnType<typeof vi.fn>
onSubmit: ReturnType<typeof vi.fn>
onInput: ReturnType<typeof vi.fn>
}

const defaultParams: BlockLayoutParams = {
Expand Down Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions src/ui/ParameterForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down