Skip to content

Commit

Permalink
Make needsTheoremInitialGoals required
Browse files Browse the repository at this point in the history
  • Loading branch information
GlebSolovev committed Nov 26, 2024
1 parent 7dcd906 commit 35130f8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ export namespace ParseCoqProjectImpl {
mockDocumentVersion,
Uri.fromPath(filePath),
coqLspClient,
new AbortController().signal // abort behaviour is not supported at the parsing stage
new AbortController().signal, // abort behaviour is not supported at the parsing stage
true // TODO: pass `ContextTheoremsRanker.needsUnwrappedNotations` here to improve performance
);
const serializedParsedFile: SerializedParsedCoqFile = {
serializedTheoremsByNames: packIntoMappedObject(
Expand Down
4 changes: 2 additions & 2 deletions src/core/inspectSourceFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function inspectSourceFile(
fileUri: Uri,
client: CoqLspClient,
abortSignal: AbortSignal,
needsTheoremInitialGoals: boolean = true,
needsTheoremInitialGoals: boolean,
eventLogger?: EventLogger
): Promise<AnalyzedFile> {
const sourceFileEnvironment = await createSourceFileEnvironment(
Expand Down Expand Up @@ -82,7 +82,7 @@ export async function createSourceFileEnvironment(
fileUri: Uri,
client: CoqLspClient,
abortSignal: AbortSignal,
needsTheoremInitialGoals: boolean = true,
needsTheoremInitialGoals: boolean,
eventLogger?: EventLogger
): Promise<SourceFileEnvironment> {
const fileTheorems = await parseCoqFile(
Expand Down
3 changes: 2 additions & 1 deletion src/test/commonTestFunctions/prepareEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export async function withPreparedEnvironment<T>(
(_hole) => true,
fileUri,
client,
new AbortController().signal
new AbortController().signal,
true // to support any ranker
)
);
const preparedEnvironment = {
Expand Down
10 changes: 7 additions & 3 deletions src/test/legacyBenchmark/benchmarkingFramework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { consoleLog, consoleLogSeparatorLine } from "./utils/loggingUtils";

export interface TestBenchmarkOptions extends TestBenchmarkOptionsWithDefaults {
filePath: string;
// TODO: support ranker
inputModelsParams: InputModelsParams;
relativePathToFile: string;
}
Expand Down Expand Up @@ -451,7 +452,8 @@ async function prepareForBenchmarkCompletions(
mockDocumentVersion,
shouldCompleteHole,
fileUri,
coqLspClient
coqLspClient,
true // TODO: pass `ranker.needsUnwrappedNotations` here
);
const llmServices: LLMServices = {
openAiService: new OpenAiService(eventLogger),
Expand Down Expand Up @@ -479,14 +481,16 @@ async function extractCompletionTargets(
documentVersion: number,
shouldCompleteHole: (hole: ProofStep) => boolean,
fileUri: Uri,
client: CoqLspClient
client: CoqLspClient,
rankerNeedsUnwrappedNotations: boolean
): Promise<[BenchmarkingCompletionTargets, SourceFileEnvironment]> {
const abortController = new AbortController();
const sourceFileEnvironment = await createSourceFileEnvironment(
documentVersion,
fileUri,
client,
abortController.signal
abortController.signal,
rankerNeedsUnwrappedNotations
);
const completionTargets = await createCompletionTargets(
documentVersion,
Expand Down

0 comments on commit 35130f8

Please sign in to comment.