thekevinscott commited on
Commit
429cfb6
·
verified ·
1 Parent(s): 5c73a61

Upload folder using huggingface_hub (part 3)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/code-points.ts +63 -0
  2. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/build-error-position.test.ts +34 -0
  3. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/build-error-position.ts +32 -0
  4. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/errors-types.ts +1 -0
  5. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/get-input-as-string.test.ts +16 -0
  6. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/get-input-as-string.ts +12 -0
  7. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/grammar-parse-error.test.ts +13 -0
  8. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/grammar-parse-error.ts +22 -0
  9. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/index.ts +2 -0
  10. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/input-parse-error.test.ts +24 -0
  11. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/input-parse-error.ts +46 -0
  12. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/is-equal.ts +7 -0
  13. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/is-point-in-range.test.ts +15 -0
  14. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/is-point-in-range.ts +6 -0
  15. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/json-dumps.ts +7 -0
  16. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/repr.ts +67 -0
  17. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/validate-non-empty.ts +6 -0
  18. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/tests/generated/iteration/iteration-with-additional-strings.test.ts +647 -0
  19. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/tests/generated/iteration/iteration-with-an-initial-string.test.ts +629 -0
  20. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/tests/generated/iteration/iteration.test.ts +171 -0
  21. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/tests/generated/validation/validate-grammar.test.ts +79 -0
  22. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/tests/generated/validation/validate-input.test.ts +319 -0
  23. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/tsconfig.build.json +12 -0
  24. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/tsconfig.json +15 -0
  25. v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/vitest.config.ts +8 -0
  26. v2-models-effort/runs/20261111-214430-dark-sunset/proxy.log +15 -0
  27. v2-models-effort/runs/20261111-214430-dark-sunset/result.json +1 -0
  28. v2-models-effort/runs/20261111-214430-dark-sunset/run.json +28 -0
  29. v2-models-effort/runs/20261111-214430-dark-sunset/run.lock +0 -0
  30. v2-models-effort/runs/20261111-214430-dark-sunset/stderr.log +0 -0
  31. v2-models-effort/runs/20261111-214430-dark-sunset/stderr.txt +1 -0
  32. v2-models-effort/runs/20261111-214430-dark-sunset/stdout.log +1 -0
  33. v2-models-effort/runs/20261111-214430-dark-sunset/transcript/.claude/projects/-target/90097121-4ffa-470f-8563-1c842390b95d.jsonl +0 -0
  34. v2-models-effort/runs/20261111-214430-flat-disk/credentials.log +175 -0
  35. v2-models-effort/runs/20261111-214430-flat-disk/git-diff.patch +0 -0
  36. v2-models-effort/runs/20261111-214430-flat-disk/git-sha.txt +1 -0
  37. v2-models-effort/runs/20261111-214430-flat-disk/manifest.json +99 -0
  38. v2-models-effort/runs/20261111-214430-flat-disk/memory.jsonl +791 -0
  39. v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/.gitignore +5 -0
  40. v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/README.md +138 -0
  41. v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/package.json +38 -0
  42. v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/gbnf.ts +34 -0
  43. v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/grammar-graph/colorize.test.ts +15 -0
  44. v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/grammar-graph/colorize.ts +10 -0
  45. v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/grammar-graph/get-input-as-code-points.test.ts +17 -0
  46. v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/grammar-graph/get-input-as-code-points.ts +34 -0
  47. v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/grammar-graph/get-parent-stack-id.test.ts +64 -0
  48. v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/grammar-graph/get-parent-stack-id.ts +16 -0
  49. v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/grammar-graph/get-serialized-rule-key.test.ts +79 -0
  50. v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/grammar-graph/get-serialized-rule-key.ts +39 -0
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/code-points.ts ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Python strings are sequences of code points, whereas JavaScript strings are sequences of UTF-16
2
+ // code units. Every position into a grammar (including the positions reported in error messages)
3
+ // is a code point offset, so strings are measured and indexed through these helpers.
4
+
5
+ let cachedSrc: string | undefined;
6
+ let cachedChars: readonly string[] = [];
7
+
8
+ // A grammar is indexed over and over while it is parsed, so the most recently indexed string is
9
+ // kept split into code points.
10
+ const getChars = (src: string): readonly string[] => {
11
+ if (src !== cachedSrc) {
12
+ cachedChars = Array.from(src);
13
+ cachedSrc = src;
14
+ }
15
+ return cachedChars;
16
+ };
17
+
18
+ /** The number of code points in `src`; use this for strings that are also indexed via `charAt`. */
19
+ export const getLength = (src: string): number => getChars(src).length;
20
+
21
+ /**
22
+ * The code point at `pos` in `src`, as a string.
23
+ *
24
+ * Throws a `RangeError` if `pos` is out of range (like Python, a negative `pos` counts from the end).
25
+ */
26
+ export const charAt = (src: string, pos: number): string => {
27
+ const chars = getChars(src);
28
+ const idx = pos < 0 ? pos + chars.length : pos;
29
+ const char = chars[idx];
30
+ if (char === undefined) {
31
+ throw new RangeError('string index out of range');
32
+ }
33
+ return char;
34
+ };
35
+
36
+ /** The code points of `src` from `start` up to (but excluding) `end`. */
37
+ export const slice = (src: string, start: number, end?: number): string => getChars(src).slice(start, end).join('');
38
+
39
+ /** The number of code points in `src`; use this for one-off measurements of (short) strings. */
40
+ export const countCodePoints = (src: string): number => {
41
+ let count = 0;
42
+ for (const _char of src) {
43
+ count += 1;
44
+ }
45
+ return count;
46
+ };
47
+
48
+ /** The code point of a single character. */
49
+ export const ord = (char: string): number => {
50
+ const codePoint = char.codePointAt(0);
51
+ if (codePoint === undefined || countCodePoints(char) !== 1) {
52
+ throw new TypeError(`ord() expected a character, but string of length ${countCodePoints(char)} found`);
53
+ }
54
+ return codePoint;
55
+ };
56
+
57
+ /** The character of a code point. */
58
+ export const chr = (codePoint: number): string => {
59
+ if (!(codePoint >= 0 && codePoint < 0x110000)) {
60
+ throw new Error('chr() arg not in range(0x110000)');
61
+ }
62
+ return String.fromCodePoint(codePoint);
63
+ };
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/build-error-position.test.ts ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { describe, expect, it, test } from 'vitest';
2
+
3
+ import { buildErrorPosition } from './build-error-position.js';
4
+
5
+ describe('buildErrorPosition', () => {
6
+ it.each<[string, number, [string, string]]>([
7
+ ['root ::= "foo"', 1, ['root ::= "foo"', ' ^']],
8
+ ['root ::= "foo"', 5, ['root ::= "foo"', ' ^']],
9
+ // multi line grammars with pos on first line
10
+ ['aa\\nbb', 1, ['aa', ' ^']],
11
+ // multi line grammars with pos on second line, first character
12
+ ['aa\\nbb', 2, ['aa\\nbb', '^']],
13
+ // multi line grammars with pos on second line, second character
14
+ ['aa\\nbb', 2 + 1, ['aa\\nbb', ' ^']],
15
+ // multi line grammars beyond error with pos on second line
16
+ ['aa\\nbb\\ncc', 2 + 1, ['aa\\nbb', ' ^']],
17
+ // multi line grammars beyond error with pos on third line, first char
18
+ ['aa\\nbb\\ncc', 2 + 2 + 0, ['aa\\nbb\\ncc', '^']],
19
+ // multi line grammars beyond error with pos on third line, second char
20
+ ['aa\\nbb\\ncc', 2 + 2 + 1, ['aa\\nbb\\ncc', ' ^']],
21
+ // multi line grammars beyond error with pos on fourth line, first char
22
+ ['aa\\nbb\\ncc\\ndd', 2 + 2 + 2 + 0, ['bb\\ncc\\ndd', '^']],
23
+ // multi line grammars beyond error with pos on fifth line, second char
24
+ ['aa\\nbb\\ncc\\ndd\\nee', 2 + 2 + 2 + 2 + 1, ['cc\\ndd\\nee', ' ^']],
25
+ ])('correctly shows position for single line grammars (%j at %i)', (grammar, pos, expected) => {
26
+ const [grammarOut, posOut] = expected;
27
+ const result = buildErrorPosition(grammar.split('\\n').join('\n'), pos);
28
+ expect(result).toEqual([...grammarOut.split('\\n'), posOut]);
29
+ });
30
+
31
+ test('it renders a message for empty input', () => {
32
+ expect(buildErrorPosition('', 0)).toEqual(['No input provided']);
33
+ });
34
+ });
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/build-error-position.ts ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { countCodePoints } from '../code-points.js';
2
+
3
+ export const MAXIMUM_NUMBER_OF_ERROR_LINES_TO_SHOW = 3;
4
+
5
+ // Indexing past the last line is an error, as it is for the reference implementation.
6
+ const getLine = (lines: string[], lineIdx: number): string => {
7
+ if (lineIdx >= lines.length) {
8
+ throw new RangeError('list index out of range');
9
+ }
10
+ return lines[lineIdx];
11
+ };
12
+
13
+ export const buildErrorPosition = (src: string, pos: number): string[] => {
14
+ if (src === '') {
15
+ return ['No input provided'];
16
+ }
17
+ const lines = src.split('\n');
18
+ const srcLength = countCodePoints(src);
19
+
20
+ let lineIdx = 0;
21
+ while (getLine(lines, lineIdx) && pos > countCodePoints(lines[lineIdx]) - 1 && pos < srcLength) {
22
+ pos -= countCodePoints(lines[lineIdx]);
23
+ lineIdx += 1;
24
+ }
25
+
26
+ const linesToShow: string[] = [];
27
+ for (let i = Math.max(0, lineIdx - (MAXIMUM_NUMBER_OF_ERROR_LINES_TO_SHOW - 1)); i < lineIdx + 1; i++) {
28
+ linesToShow.push(lines[i]);
29
+ }
30
+
31
+ return [...linesToShow, `${' '.repeat(Math.max(0, pos))}^`];
32
+ };
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/errors-types.ts ADDED
@@ -0,0 +1 @@
 
 
1
+ export type ValidInput = string | number | number[];
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/get-input-as-string.test.ts ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { describe, expect, it } from 'vitest';
2
+
3
+ import type { ValidInput } from './errors-types.js';
4
+ import { getInputAsString } from './get-input-as-string.js';
5
+
6
+ describe('getInputAsString', () => {
7
+ it.each<[ValidInput, string]>([
8
+ ['hello', 'hello'],
9
+ [[104, 101, 108, 108, 111], 'hello'],
10
+ [104, 'h'],
11
+ [0x1f600, '😀'],
12
+ [[0x1f600, 0x1f601], '😀😁'],
13
+ ])('correctly converts strings to strings (%j)', (input, expected) => {
14
+ expect(getInputAsString(input)).toBe(expected);
15
+ });
16
+ });
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/get-input-as-string.ts ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { chr } from '../code-points.js';
2
+ import type { ValidInput } from './errors-types.js';
3
+
4
+ export const getInputAsString = (src: ValidInput): string => {
5
+ if (typeof src === 'string') {
6
+ return src;
7
+ }
8
+ if (typeof src === 'number') {
9
+ return chr(src);
10
+ }
11
+ return src.map((cp) => chr(cp)).join('');
12
+ };
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/grammar-parse-error.test.ts ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { describe, expect, test } from 'vitest';
2
+
3
+ import { GRAMMAR_PARSER_ERROR_HEADER_MESSAGE, GrammarParseError } from './grammar-parse-error.js';
4
+
5
+ describe('GrammarParseError', () => {
6
+ test('it renders a message', () => {
7
+ const grammar = 'aa\\nbb\\ncc\\ndd\\nee';
8
+ const pos = 5;
9
+ const reason = 'reason';
10
+ const err = new GrammarParseError(grammar.split('\\n').join('\n'), pos, reason);
11
+ expect(err.message).toBe([GRAMMAR_PARSER_ERROR_HEADER_MESSAGE(reason), '', 'aa', 'bb', 'cc', ' ^'].join('\n'));
12
+ });
13
+ });
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/grammar-parse-error.ts ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { buildErrorPosition } from './build-error-position.js';
2
+
3
+ export const GRAMMAR_PARSER_ERROR_HEADER_MESSAGE = (reason: string): string => `Failed to parse grammar: ${reason}`;
4
+
5
+ export class GrammarParseError extends Error {
6
+ readonly grammar: string;
7
+ readonly pos: number;
8
+ readonly reason: string;
9
+
10
+ constructor(grammar: string, pos: number, reason: string) {
11
+ super([GRAMMAR_PARSER_ERROR_HEADER_MESSAGE(reason), '', ...buildErrorPosition(grammar, pos)].join('\n'));
12
+ this.name = 'GrammarParseError';
13
+ this.grammar = grammar;
14
+ this.pos = pos;
15
+ this.reason = reason;
16
+ }
17
+
18
+ /** Two errors are considered equal if they describe the same failure, i.e. share a message. */
19
+ equals(other: unknown): boolean {
20
+ return this.message === (other instanceof Error ? other.message : String(other));
21
+ }
22
+ }
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/index.ts ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ export { GrammarParseError } from './grammar-parse-error.js';
2
+ export { InputParseError } from './input-parse-error.js';
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/input-parse-error.test.ts ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { describe, expect, test } from 'vitest';
2
+
3
+ import { INPUT_PARSER_ERROR_HEADER_MESSAGE, InputParseError } from './input-parse-error.js';
4
+
5
+ describe('InputParseError', () => {
6
+ test('it renders a message', () => {
7
+ const input = 'some input';
8
+ const pos = 1;
9
+ const err = new InputParseError(input, pos);
10
+ expect(err.message).toBe([INPUT_PARSER_ERROR_HEADER_MESSAGE, '', input, ' ^'].join('\n'));
11
+ });
12
+
13
+ test('it renders a message for code point', () => {
14
+ const pos = 0;
15
+ const err = new InputParseError('a', pos);
16
+ expect(err.message).toBe([INPUT_PARSER_ERROR_HEADER_MESSAGE, '', 'a', '^'].join('\n'));
17
+ });
18
+
19
+ test('it renders a message for code points', () => {
20
+ const pos = 2;
21
+ const err = new InputParseError('abcd', pos);
22
+ expect(err.message).toBe([INPUT_PARSER_ERROR_HEADER_MESSAGE, '', 'abcd', ' ^'].join('\n'));
23
+ });
24
+ });
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/errors/input-parse-error.ts ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { countCodePoints } from '../code-points.js';
2
+ import { buildErrorPosition } from './build-error-position.js';
3
+ import type { ValidInput } from './errors-types.js';
4
+ import { getInputAsString } from './get-input-as-string.js';
5
+
6
+ export const INPUT_PARSER_ERROR_HEADER_MESSAGE = 'Failed to parse input string:';
7
+
8
+ export class InputParseError extends Error {
9
+ readonly mostRecentInput: ValidInput;
10
+ readonly pos: number;
11
+ readonly previousInput: ValidInput;
12
+
13
+ constructor(mostRecentInput: ValidInput, pos: number, previousInput: ValidInput = '') {
14
+ super(
15
+ [
16
+ INPUT_PARSER_ERROR_HEADER_MESSAGE,
17
+ '',
18
+ ...buildErrorPosition(
19
+ `${getInputAsString(previousInput)}${getInputAsString(mostRecentInput)}`,
20
+ pos + countCodePoints(getInputAsString(previousInput)),
21
+ ),
22
+ ].join('\n'),
23
+ );
24
+ this.name = 'InputParseError';
25
+ this.mostRecentInput = mostRecentInput;
26
+ this.pos = pos;
27
+ this.previousInput = previousInput;
28
+ }
29
+
30
+ get src(): string {
31
+ return `${getInputAsString(this.previousInput)}${getInputAsString(this.mostRecentInput)}`;
32
+ }
33
+
34
+ get errorForMostRecentInput(): string {
35
+ return [
36
+ INPUT_PARSER_ERROR_HEADER_MESSAGE,
37
+ '',
38
+ ...buildErrorPosition(getInputAsString(this.mostRecentInput), this.pos),
39
+ ].join('\n');
40
+ }
41
+
42
+ /** Two errors are considered equal if they describe the same failure, i.e. share a message. */
43
+ equals(other: unknown): boolean {
44
+ return this.message === (other instanceof Error ? other.message : String(other));
45
+ }
46
+ }
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/is-equal.ts ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ /** Compares two values, comparing arrays (such as ranges, or lists of code points) element by element. */
2
+ export const isEqual = (a: unknown, b: unknown): boolean => {
3
+ if (Array.isArray(a) && Array.isArray(b)) {
4
+ return a.length === b.length && a.every((value, idx) => isEqual(value, b[idx]));
5
+ }
6
+ return a === b;
7
+ };
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/is-point-in-range.test.ts ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { describe, expect, it } from 'vitest';
2
+
3
+ import { isPointInRange } from './is-point-in-range.js';
4
+
5
+ describe('isPointInRange', () => {
6
+ it.each<[number, [number, number], boolean]>([
7
+ [96, [97, 122], false],
8
+ [97, [97, 122], true],
9
+ [98, [97, 122], true],
10
+ [122, [97, 122], true],
11
+ [123, [97, 122], false],
12
+ ])('checks if point is in range (%i in %j is %s)', (point, range, expectation) => {
13
+ expect(isPointInRange(point, range)).toBe(expectation);
14
+ });
15
+ });
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/is-point-in-range.ts ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ export const isPointInRange = (point: number, givenRange: readonly [number, number]): boolean => {
2
+ if (!Number.isInteger(point)) {
3
+ throw new Error('point must be an integer');
4
+ }
5
+ return point >= givenRange[0] && point <= givenRange[1];
6
+ };
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/json-dumps.ts ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ // Serializes a value the way the reference implementation does, with a space after each item separator.
2
+ export const jsonDumps = (value: unknown): string => {
3
+ if (Array.isArray(value)) {
4
+ return `[${value.map(jsonDumps).join(', ')}]`;
5
+ }
6
+ return JSON.stringify(value);
7
+ };
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/repr.ts ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const ESCAPES: Record<string, string> = {
2
+ '\\': '\\\\',
3
+ '\n': '\\n',
4
+ '\r': '\\r',
5
+ '\t': '\\t',
6
+ };
7
+
8
+ // Control, format, surrogate, private use and unassigned characters, along with every separator.
9
+ const NON_PRINTABLE = /^[\p{C}\p{Z}]$/u;
10
+
11
+ const escapeChar = (char: string, quote: string): string => {
12
+ if (char === quote) {
13
+ return `\\${quote}`;
14
+ }
15
+ if (char in ESCAPES) {
16
+ return ESCAPES[char];
17
+ }
18
+ if (char === ' ' || !NON_PRINTABLE.test(char)) {
19
+ return char;
20
+ }
21
+ const codePoint = char.codePointAt(0) as number;
22
+ const hex = codePoint.toString(16);
23
+ if (codePoint <= 0xff) {
24
+ return `\\x${hex.padStart(2, '0')}`;
25
+ }
26
+ if (codePoint <= 0xffff) {
27
+ return `\\u${hex.padStart(4, '0')}`;
28
+ }
29
+ return `\\U${hex.padStart(8, '0')}`;
30
+ };
31
+
32
+ const reprString = (value: string): string => {
33
+ const quote = value.includes("'") && !value.includes('"') ? '"' : "'";
34
+ return `${quote}${Array.from(value, (char) => escapeChar(char, quote)).join('')}${quote}`;
35
+ };
36
+
37
+ const isPlainObject = (value: object): boolean => {
38
+ const prototype = Object.getPrototypeOf(value);
39
+ return prototype === Object.prototype || prototype === null;
40
+ };
41
+
42
+ /**
43
+ * Formats a value for inclusion in an error message.
44
+ *
45
+ * The output follows Python's `repr` (which is what the reference implementation interpolates into
46
+ * its error messages), so that the messages of both implementations line up.
47
+ */
48
+ export const repr = (value: unknown): string => {
49
+ if (value === null || value === undefined) {
50
+ return 'None';
51
+ }
52
+ if (typeof value === 'boolean') {
53
+ return value ? 'True' : 'False';
54
+ }
55
+ if (typeof value === 'string') {
56
+ return reprString(value);
57
+ }
58
+ if (Array.isArray(value)) {
59
+ return `[${value.map(repr).join(', ')}]`;
60
+ }
61
+ if (typeof value === 'object' && isPlainObject(value)) {
62
+ return `{${Object.entries(value)
63
+ .map(([key, entry]) => `${repr(key)}: ${repr(entry)}`)
64
+ .join(', ')}}`;
65
+ }
66
+ return String(value);
67
+ };
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/src/utils/validate-non-empty.ts ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ export const validateNonEmpty = (value: number[]): number[] => {
2
+ if (!value || value.length === 0) {
3
+ throw new Error('Value cannot be empty.');
4
+ }
5
+ return value;
6
+ };
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/tests/generated/iteration/iteration-with-additional-strings.test.ts ADDED
@@ -0,0 +1,647 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { describe, expect, test } from 'vitest';
2
+
3
+ import { GBNF, InputParseError, RuleChar, RuleCharExclude, RuleEnd } from '../../../src/index.js';
4
+
5
+ type Range = [number, number];
6
+
7
+ type ExpectedRule =
8
+ | { type: 'char'; value: (number | Range)[] }
9
+ | { type: 'char_exclude'; value: (number | Range)[] }
10
+ | { type: 'end' };
11
+
12
+ const ord = (char: string): number => char.codePointAt(0) as number;
13
+
14
+ const transformedExpectedDict = (e: ExpectedRule): RuleChar | RuleCharExclude | RuleEnd => {
15
+ if (e.type === 'char') {
16
+ return new RuleChar(e.value);
17
+ } else if (e.type === 'char_exclude') {
18
+ return new RuleCharExclude(e.value);
19
+ } else if (e.type === 'end') {
20
+ return new RuleEnd();
21
+ } else {
22
+ throw new Error(`Unknown type found in expectation array: ${JSON.stringify(e)}`);
23
+ }
24
+ };
25
+
26
+ // The order of the rules is not part of the expectation, so both sides get sorted by their serialized form.
27
+ const sortedByJson = <T>(rules: Iterable<T>): T[] =>
28
+ [...rules]
29
+ .map((rule) => ({ key: JSON.stringify(rule), rule }))
30
+ .sort((a, b) => (a.key < b.key ? -1 : a.key > b.key ? 1 : 0))
31
+ .map(({ rule }) => rule);
32
+
33
+ describe('iteration', () => {
34
+ test.each<[grammar: string, starting: string, additional: string]>([
35
+ // single char rule
36
+ ['root ::= "foo"', 'f', '1'],
37
+ ['root ::= "foo"', 'f', 'b'],
38
+ ['root ::= "foo"', 'f', 'o1'],
39
+ ['root ::= "foo"', 'f', 'ooo'],
40
+ ['root ::= "foo"', 'f', 'ooooooo'],
41
+ // two char rules
42
+ ['root ::= "foo" | "bar"', 'f', '1'],
43
+ ['root ::= "foo" | "bar"', 'b', '1'],
44
+ ['root ::= "foo" | "bar"', 'f', 'o1'],
45
+ ['root ::= "foo" | "bar"', 'b', 'a1'],
46
+ ['root ::= "foo" | "bar"', 'f', 'ooo'],
47
+ ['root ::= "foo" | "bar"', 'b', 'arrr'],
48
+ // three char rules
49
+ ['root ::= "foo" | "bar" | "baz"', 'f', '1'],
50
+ ['root ::= "foo" | "bar" | "baz"', 'f', 'z'],
51
+ ['root ::= "foo" | "bar" | "baz"', 'b', 'b1'],
52
+ ['root ::= "foo" | "bar" | "baz"', 'f', 'o1'],
53
+ ['root ::= "foo" | "bar" | "baz"', 'b', 'al'],
54
+ ['root ::= "foo" | "bar" | "baz"', 'f', 'ooo'],
55
+ ['root ::= "foo" | "bar" | "baz"', 'b', 'azrr'],
56
+ // expressions
57
+ [
58
+ `root ::= foo
59
+ foo ::="foo"`,
60
+ 'f',
61
+ '1',
62
+ ],
63
+ [
64
+ `root ::= foo
65
+ foo ::="foo"`,
66
+ 'f',
67
+ 'b',
68
+ ],
69
+ [
70
+ `root ::= foo
71
+ foo ::="foo"`,
72
+ 'f',
73
+ 'o1',
74
+ ],
75
+ [
76
+ `root ::= foo
77
+ foo ::="foo"`,
78
+ 'f',
79
+ 'ooo',
80
+ ],
81
+ // expression and a char rule
82
+ [
83
+ `root::=foo|"bar"
84
+ foo::="foo"`,
85
+ 'f',
86
+ '1',
87
+ ],
88
+ [
89
+ `root::=foo|"bar"
90
+ foo::="foo"`,
91
+ 'f',
92
+ 'z',
93
+ ],
94
+ [
95
+ `root::=foo|"bar"
96
+ foo::="foo"`,
97
+ 'b',
98
+ 'b1',
99
+ ],
100
+ [
101
+ `root::=foo|"bar"
102
+ foo::="foo"`,
103
+ 'f',
104
+ 'o1',
105
+ ],
106
+ [
107
+ `root::=foo|"bar"
108
+ foo::="foo"`,
109
+ 'f',
110
+ 'ooo',
111
+ ],
112
+ [
113
+ `root::=foo|"bar"
114
+ foo::="foo"`,
115
+ 'b',
116
+ 'arr',
117
+ ],
118
+ // two expressions
119
+ [
120
+ `root::= foo | bar
121
+ foo::="foo"
122
+ bar::="bar"`,
123
+ 'f',
124
+ '1',
125
+ ],
126
+ [
127
+ `root::= foo | bar
128
+ foo::="foo"
129
+ bar::="bar"`,
130
+ 'f',
131
+ 'z',
132
+ ],
133
+ [
134
+ `root::= foo | bar
135
+ foo::="foo"
136
+ bar::="bar"`,
137
+ 'b',
138
+ '1',
139
+ ],
140
+ [
141
+ `root::= foo | bar
142
+ foo::="foo"
143
+ bar::="bar"`,
144
+ 'f',
145
+ 'o1',
146
+ ],
147
+ [
148
+ `root::= foo | bar
149
+ foo::="foo"
150
+ bar::="bar"`,
151
+ 'f',
152
+ 'ooo',
153
+ ],
154
+ [
155
+ `root::= foo | bar
156
+ foo::="foo"
157
+ bar::="bar"`,
158
+ 'b',
159
+ 'arr',
160
+ ],
161
+ // nested expressions
162
+ [
163
+ `root ::= f | b
164
+ f ::= fo
165
+ b ::= ba
166
+ fo ::= foo
167
+ ba ::= bar | baz
168
+ foo ::= "foo"
169
+ bar ::= "bar"
170
+ baz ::= "baz"`,
171
+ 'f',
172
+ '1',
173
+ ],
174
+ [
175
+ `root ::= f | b
176
+ f ::= fo
177
+ b ::= ba
178
+ fo ::= foo
179
+ ba ::= bar | baz
180
+ foo ::= "foo"
181
+ bar ::= "bar"
182
+ baz ::= "baz"`,
183
+ 'f',
184
+ 'z',
185
+ ],
186
+ [
187
+ `root ::= f | b
188
+ f ::= fo
189
+ b ::= ba
190
+ fo ::= foo
191
+ ba ::= bar | baz
192
+ foo ::= "foo"
193
+ bar ::= "bar"
194
+ baz ::= "baz"`,
195
+ 'b',
196
+ '1',
197
+ ],
198
+ [
199
+ `root ::= f | b
200
+ f ::= fo
201
+ b ::= ba
202
+ fo ::= foo
203
+ ba ::= bar | baz
204
+ foo ::= "foo"
205
+ bar ::= "bar"
206
+ baz ::= "baz"`,
207
+ 'f',
208
+ 'o1',
209
+ ],
210
+ [
211
+ `root ::= f | b
212
+ f ::= fo
213
+ b ::= ba
214
+ fo ::= foo
215
+ ba ::= bar | baz
216
+ foo ::= "foo"
217
+ bar ::= "bar"
218
+ baz ::= "baz"`,
219
+ 'f',
220
+ 'ooo',
221
+ ],
222
+ [
223
+ `root ::= f | b
224
+ f ::= fo
225
+ b ::= ba
226
+ fo ::= foo
227
+ ba ::= bar | baz
228
+ foo ::= "foo"
229
+ bar ::= "bar"
230
+ baz ::= "baz"`,
231
+ 'b',
232
+ 'arr',
233
+ ],
234
+ [
235
+ `root ::= f | b
236
+ f ::= fo
237
+ b ::= ba
238
+ fo ::= foo
239
+ ba ::= bar | baz
240
+ foo ::= "foo"
241
+ bar ::= "bar"
242
+ baz ::= "baz"`,
243
+ 'b',
244
+ 'azr',
245
+ ],
246
+ // ranges
247
+ ['root ::= [a-z]', 'a', 'A'],
248
+ ['root ::= [a-z]', 'a', '0'],
249
+ ['root ::= [a-z]', 'a', 'az'],
250
+ // range with ? modifier
251
+ ['root ::= [a-z]?', 'a', 'A'],
252
+ ['root ::= [a-z]?', 'a', '0'],
253
+ ['root ::= [a-z]?', 'a', 'az'],
254
+ // range with + modifier
255
+ ['root ::= [a-z]+', 'a', 'A'],
256
+ ['root ::= [a-z]+', 'a', '0'],
257
+ ['root ::= [a-z]+', 'a', 'z0'],
258
+ // range with * modifier
259
+ ['root ::= [a-z]*', 'a', 'A'],
260
+ ['root ::= [a-z]*', 'a', '0'],
261
+ ['root ::= [a-z]*', 'a', 'z0'],
262
+ ])('it raises if encountering grammar %j with starting %j and additional %j', (grammar, starting, additional) => {
263
+ const state = GBNF(grammar, starting);
264
+ expect(() => state.add(additional)).toThrow(InputParseError);
265
+ });
266
+
267
+ test.each<[grammar: string, starting: string, additional: string, expected: ExpectedRule[]]>([
268
+ // single char rule
269
+ ['root ::= "foo"', '', 'f', [{ type: 'char', value: [ord('o')] }]],
270
+ ['root ::= "foo"', 'f', 'o', [{ type: 'char', value: [ord('o')] }]],
271
+ ['root ::= "foo"', 'fo', 'o', [{ type: 'end' }]],
272
+ // two char rules
273
+ ['root ::= "foo" | "bar" ', '', 'f', [{ type: 'char', value: [ord('o')] }]],
274
+ ['root ::= "foo" | "bar" ', 'f', 'o', [{ type: 'char', value: [ord('o')] }]],
275
+ ['root ::= "foo" | "bar" ', 'fo', 'o', [{ type: 'end' }]],
276
+ ['root ::= "foo" | "bar" ', '', 'b', [{ type: 'char', value: [ord('a')] }]],
277
+ ['root ::= "foo" | "bar" ', 'b', 'a', [{ type: 'char', value: [ord('r')] }]],
278
+ ['root ::= "foo" | "bar" ', 'ba', 'r', [{ type: 'end' }]],
279
+ // three char rules
280
+ [
281
+ 'root ::= "foo" | "bar" | "baz"',
282
+ 'b',
283
+ 'a',
284
+ [
285
+ { type: 'char', value: [ord('r')] },
286
+ { type: 'char', value: [ord('z')] },
287
+ ],
288
+ ],
289
+ // char not
290
+ ['root ::= [^f] "o"', 'g', 'o', [{ type: 'end' }]],
291
+ ['root ::= [^A-Z]', '', 'a', [{ type: 'end' }]],
292
+ ['root ::= [^A-Z0-9]', '', 'a', [{ type: 'end' }]],
293
+ ['root ::= [^A-Z0-9_-]', '', 'a', [{ type: 'end' }]],
294
+ // expressions
295
+ [
296
+ `root ::= foo
297
+ foo ::= "foo"`,
298
+ '',
299
+ 'f',
300
+ [{ type: 'char', value: [ord('o')] }],
301
+ ],
302
+ [
303
+ `root ::= foo
304
+ foo ::= "foo"`,
305
+ 'f',
306
+ 'o',
307
+ [{ type: 'char', value: [ord('o')] }],
308
+ ],
309
+ [
310
+ `root ::= foo
311
+ foo ::= "foo"`,
312
+ 'fo',
313
+ 'o',
314
+ [{ type: 'end' }],
315
+ ],
316
+ // expression and a char rule
317
+ [
318
+ `root ::= foo | "bar"
319
+ foo ::= "foo"`,
320
+ '',
321
+ 'f',
322
+ [{ type: 'char', value: [ord('o')] }],
323
+ ],
324
+ [
325
+ `root ::= foo | "bar"
326
+ foo ::= "foo"`,
327
+ 'f',
328
+ 'o',
329
+ [{ type: 'char', value: [ord('o')] }],
330
+ ],
331
+ [
332
+ `root ::= foo | "bar"
333
+ foo ::= "foo"`,
334
+ 'fo',
335
+ 'o',
336
+ [{ type: 'end' }],
337
+ ],
338
+ [
339
+ `root ::= foo | "bar"
340
+ foo ::= "foo"`,
341
+ '',
342
+ 'b',
343
+ [{ type: 'char', value: [ord('a')] }],
344
+ ],
345
+ [
346
+ `root ::= foo | "bar"
347
+ foo ::= "foo"`,
348
+ 'b',
349
+ 'a',
350
+ [{ type: 'char', value: [ord('r')] }],
351
+ ],
352
+ [
353
+ `root ::= foo | "bar"
354
+ foo ::= "foo"`,
355
+ 'ba',
356
+ 'r',
357
+ [{ type: 'end' }],
358
+ ],
359
+ // two expressions
360
+ [
361
+ `root ::= foo | bar
362
+ foo ::= "foo"
363
+ bar ::= "bar"`,
364
+ '',
365
+ 'f',
366
+ [{ type: 'char', value: [ord('o')] }],
367
+ ],
368
+ [
369
+ `
370
+ root ::= foo | bar
371
+ foo ::= "foo"
372
+ bar ::= "bar"`,
373
+ 'f',
374
+ 'o',
375
+ [{ type: 'char', value: [ord('o')] }],
376
+ ],
377
+ [
378
+ `
379
+ root ::= foo | bar
380
+ foo ::= "foo"
381
+ bar ::= "bar"`,
382
+ 'fo',
383
+ 'o',
384
+ [{ type: 'end' }],
385
+ ],
386
+ [
387
+ `root ::= foo | bar
388
+ foo ::= "foo"
389
+ bar ::= "bar"`,
390
+ '',
391
+ 'b',
392
+ [{ type: 'char', value: [ord('a')] }],
393
+ ],
394
+ [
395
+ `root ::= foo | bar
396
+ foo ::= "foo"
397
+ bar ::= "bar"`,
398
+ 'b',
399
+ 'a',
400
+ [{ type: 'char', value: [ord('r')] }],
401
+ ],
402
+ [
403
+ `root ::= foo | bar
404
+ foo ::= "foo"
405
+ bar ::= "bar"`,
406
+ 'ba',
407
+ 'r',
408
+ [{ type: 'end' }],
409
+ ],
410
+ // nested expressions
411
+ [
412
+ `
413
+ root ::= f | b
414
+ f ::= fo
415
+ b ::= ba
416
+ fo ::= foo
417
+ ba ::= bar | baz
418
+ foo ::= "foo"
419
+ bar ::= "bar"
420
+ baz ::= "baz"`,
421
+ '',
422
+ 'f',
423
+ [{ type: 'char', value: [ord('o')] }],
424
+ ],
425
+ [
426
+ `root ::= f | b
427
+ f ::= fo
428
+ b ::= ba
429
+ fo ::= foo
430
+ ba ::= bar | baz
431
+ foo ::= "foo"
432
+ bar ::= "bar"
433
+ baz ::= "baz"`,
434
+ 'f',
435
+ 'o',
436
+ [{ type: 'char', value: [ord('o')] }],
437
+ ],
438
+ [
439
+ `root ::= f | b
440
+ f ::= fo
441
+ b ::= ba
442
+ fo ::= foo
443
+ ba ::= bar | baz
444
+ foo ::= "foo"
445
+ bar ::= "bar"
446
+ baz ::= "baz"`,
447
+ 'fo',
448
+ 'o',
449
+ [{ type: 'end' }],
450
+ ],
451
+ [
452
+ `root ::= f | b
453
+ f ::= fo
454
+ b ::= ba
455
+ fo ::= foo
456
+ ba ::= bar | baz
457
+ foo ::= "foo"
458
+ bar ::= "bar"
459
+ baz ::= "baz"`,
460
+ '',
461
+ 'b',
462
+ [{ type: 'char', value: [ord('a')] }],
463
+ ],
464
+ [
465
+ `
466
+ root ::= f | b
467
+ f ::= fo
468
+ b ::= ba
469
+ fo ::= foo
470
+ ba ::= bar | baz
471
+ foo ::= "foo"
472
+ bar ::= "bar"
473
+ baz ::= "baz"`,
474
+ 'b',
475
+ 'a',
476
+ [
477
+ { type: 'char', value: [ord('r')] },
478
+ { type: 'char', value: [ord('z')] },
479
+ ],
480
+ ],
481
+ [
482
+ `
483
+ root ::= f | b
484
+ f ::= fo
485
+ b ::= ba
486
+ fo ::= foo
487
+ ba ::= bar | baz
488
+ foo ::= "foo"
489
+ bar ::= "bar"
490
+ baz ::= "baz"`,
491
+ 'ba',
492
+ 'r',
493
+ [{ type: 'end' }],
494
+ ],
495
+ [
496
+ `
497
+ root ::= f | b
498
+ f ::= fo
499
+ b ::= ba
500
+ fo ::= foo
501
+ ba ::= bar | baz
502
+ foo ::= "foo"
503
+ bar ::= "bar"
504
+ baz ::= "baz"`,
505
+ 'ba',
506
+ 'z',
507
+ [{ type: 'end' }],
508
+ ],
509
+ // ranges
510
+ ['root ::= [a-z]', '', 'a', [{ type: 'end' }]],
511
+ ['root ::= [a-z]', '', 'm', [{ type: 'end' }]],
512
+ ['root ::= [a-z]', '', 'z', [{ type: 'end' }]],
513
+ ['root ::= [a-zA-Z]', '', 'a', [{ type: 'end' }]],
514
+ ['root ::= [a-zA-Z]', '', 'Z', [{ type: 'end' }]],
515
+ ['root ::= [a-zA-Z0-9]', '', 'Z', [{ type: 'end' }]],
516
+ ['root ::= [a-zA-Z0-9]', '', '0', [{ type: 'end' }]],
517
+ ['root ::= [a-zA-Z0-9]', '', '9', [{ type: 'end' }]],
518
+ // range with ? modifier
519
+ ['root ::= [a-z]?', '', 'a', [{ type: 'end' }]],
520
+ ['root ::= [a-zA-Z]?', '', 'Z', [{ type: 'end' }]],
521
+ ['root ::= [a-zA-Z0-9]?', '', '0', [{ type: 'end' }]],
522
+ // range with + modifier
523
+ ['root ::= [a-z]+', '', 'a', [{ type: 'char', value: [[ord('a'), ord('z')]] }, { type: 'end' }]],
524
+ [
525
+ 'root ::= [a-zA-Z]+',
526
+ '',
527
+ 'Z',
528
+ [
529
+ {
530
+ type: 'char',
531
+ value: [
532
+ [ord('a'), ord('z')],
533
+ [ord('A'), ord('Z')],
534
+ ],
535
+ },
536
+ { type: 'end' },
537
+ ],
538
+ ],
539
+ [
540
+ 'root ::= [a-zA-Z]+',
541
+ 'azA',
542
+ 'Z',
543
+ [
544
+ {
545
+ type: 'char',
546
+ value: [
547
+ [ord('a'), ord('z')],
548
+ [ord('A'), ord('Z')],
549
+ ],
550
+ },
551
+ { type: 'end' },
552
+ ],
553
+ ],
554
+ // range with * modifier
555
+ ['root ::= [a-z]*', '', 'a', [{ type: 'char', value: [[ord('a'), ord('z')]] }, { type: 'end' }]],
556
+ [
557
+ 'root ::= [a-zA-Z]+',
558
+ '',
559
+ 'Z',
560
+ [
561
+ {
562
+ type: 'char',
563
+ value: [
564
+ [ord('a'), ord('z')],
565
+ [ord('A'), ord('Z')],
566
+ ],
567
+ },
568
+ { type: 'end' },
569
+ ],
570
+ ],
571
+ [
572
+ 'root ::= [a-zA-Z]+',
573
+ 'acczABC',
574
+ 'Z',
575
+ [
576
+ {
577
+ type: 'char',
578
+ value: [
579
+ [ord('a'), ord('z')],
580
+ [ord('A'), ord('Z')],
581
+ ],
582
+ },
583
+ { type: 'end' },
584
+ ],
585
+ ],
586
+ ['root ::= "foo" | "bar" | "baz" | "bazaar" | "barrington" ', 'baza', 'a', [{ type: 'char', value: [ord('r')] }]],
587
+ // char not with modifiers
588
+ [
589
+ 'root ::= [^f]+ "o"',
590
+ 'aaa',
591
+ 'a',
592
+ [
593
+ { type: 'char_exclude', value: [ord('f')] },
594
+ { type: 'char', value: [ord('o')] },
595
+ ],
596
+ ],
597
+ ['root ::= [^A-Z]+', 'abc', 'd', [{ type: 'char_exclude', value: [[ord('A'), ord('Z')]] }, { type: 'end' }]],
598
+ [
599
+ 'root ::= [^A-Z0-9]*',
600
+ 'abc',
601
+ 'd',
602
+ [
603
+ {
604
+ type: 'char_exclude',
605
+ value: [
606
+ [ord('A'), ord('Z')],
607
+ [ord('0'), ord('9')],
608
+ ],
609
+ },
610
+ { type: 'end' },
611
+ ],
612
+ ],
613
+ [
614
+ 'root ::= [^A-Z0-9_-]*',
615
+ 'abc',
616
+ 'd',
617
+ [
618
+ { type: 'char_exclude', value: [[ord('A'), ord('Z')], [ord('0'), ord('9')], ord('_'), ord('-')] },
619
+ { type: 'end' },
620
+ ],
621
+ ],
622
+ ])('it parses a grammar %j with starting %j and additional %j #%#', (grammar, starting, additional, expected) => {
623
+ let state = GBNF(grammar, starting);
624
+ state = state.add(additional);
625
+ expect(sortedByJson(state)).toStrictEqual(sortedByJson(expected.map(transformedExpectedDict)));
626
+ });
627
+
628
+ test.each([false, true])('it raises a particular error: %j', (errorForMostRecentInput) => {
629
+ const grammar = 'root ::= "bar"';
630
+ let state = GBNF(grammar);
631
+ state = state.add('b');
632
+ state = state.add('a');
633
+ let err: unknown;
634
+ try {
635
+ state.add('z');
636
+ } catch (e) {
637
+ err = e;
638
+ }
639
+ expect(err).toBeInstanceOf(InputParseError);
640
+ const expectedError = new InputParseError('z', 0, 'ba');
641
+ if (errorForMostRecentInput) {
642
+ expect((err as InputParseError).errorForMostRecentInput).toBe(expectedError.errorForMostRecentInput);
643
+ } else {
644
+ expect((err as InputParseError).message).toBe(expectedError.message);
645
+ }
646
+ });
647
+ });
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/tests/generated/iteration/iteration-with-an-initial-string.test.ts ADDED
@@ -0,0 +1,629 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { describe, expect, test } from 'vitest';
2
+
3
+ import { GBNF, RuleChar, RuleCharExclude, RuleEnd } from '../../../src/index.js';
4
+
5
+ type Range = [number, number];
6
+
7
+ type ExpectedRule =
8
+ | { type: 'char'; value: (number | Range)[] }
9
+ | { type: 'char_exclude'; value: (number | Range)[] }
10
+ | { type: 'end' };
11
+
12
+ const ord = (char: string): number => char.codePointAt(0) as number;
13
+
14
+ const transformedExpectedDict = (e: ExpectedRule): RuleChar | RuleCharExclude | RuleEnd => {
15
+ if (e.type === 'char') {
16
+ return new RuleChar(e.value);
17
+ } else if (e.type === 'char_exclude') {
18
+ return new RuleCharExclude(e.value);
19
+ } else if (e.type === 'end') {
20
+ return new RuleEnd();
21
+ } else {
22
+ throw new Error(`Unknown type found in expectation array: ${JSON.stringify(e)}`);
23
+ }
24
+ };
25
+
26
+ // The order of the rules is not part of the expectation, so both sides get sorted by their serialized form.
27
+ const sortedByJson = <T>(rules: Iterable<T>): T[] =>
28
+ [...rules]
29
+ .map((rule) => ({ key: JSON.stringify(rule), rule }))
30
+ .sort((a, b) => (a.key < b.key ? -1 : a.key > b.key ? 1 : 0))
31
+ .map(({ rule }) => rule);
32
+
33
+ describe('iteration', () => {
34
+ test.each<[grammar: string, inputString: string, expected: ExpectedRule[]]>([
35
+ // single char rule
36
+ ['root ::= "foo"', '', [{ type: 'char', value: [ord('f')] }]],
37
+ ['root ::= "foo"', 'f', [{ type: 'char', value: [ord('o')] }]],
38
+ ['root ::= "foo"', 'fo', [{ type: 'char', value: [ord('o')] }]],
39
+ ['root ::= "foo"', 'foo', [{ type: 'end' }]],
40
+ // two char rules
41
+ [
42
+ 'root ::= "foo" | "bar" ',
43
+ '',
44
+ [
45
+ { type: 'char', value: [ord('f')] },
46
+ { type: 'char', value: [ord('b')] },
47
+ ],
48
+ ],
49
+ ['root ::= "foo" | "bar" ', 'f', [{ type: 'char', value: [ord('o')] }]],
50
+ ['root ::= "foo" | "bar" ', 'fo', [{ type: 'char', value: [ord('o')] }]],
51
+ ['root ::= "foo" | "bar" ', 'foo', [{ type: 'end' }]],
52
+ ['root ::= "foo" | "bar" ', 'b', [{ type: 'char', value: [ord('a')] }]],
53
+ ['root ::= "foo" | "bar" ', 'ba', [{ type: 'char', value: [ord('r')] }]],
54
+ ['root ::= "foo" | "bar" ', 'bar', [{ type: 'end' }]],
55
+ // three char rules
56
+ [
57
+ 'root ::= "foo" | "bar" | "baz"',
58
+ 'ba',
59
+ [
60
+ { type: 'char', value: [ord('r')] },
61
+ { type: 'char', value: [ord('z')] },
62
+ ],
63
+ ],
64
+ // chars that shadow built-in characters
65
+ ['root ::= "["', '[', [{ type: 'end' }]],
66
+ ['root ::= "]"', ']', [{ type: 'end' }]],
67
+ ['root ::= "[]"', '[]', [{ type: 'end' }]],
68
+ ['root ::= "{"', '{', [{ type: 'end' }]],
69
+ ['root ::= "}"', '}', [{ type: 'end' }]],
70
+ ['root ::= "{}"', '{}', [{ type: 'end' }]],
71
+ ['root ::= "[{}]"', '[{}]', [{ type: 'end' }]],
72
+ // ('root ::= "[{\"}]"', '[{"}]', [
73
+ // { "type": 'end' },
74
+ // ]),
75
+ // char not
76
+ ['root ::= [^f] "o"', '', [{ type: 'char_exclude', value: [ord('f')] }]],
77
+ ['root ::= [^f] "o"', 'a', [{ type: 'char', value: [ord('o')] }]],
78
+ ['root ::= [^A-Z]', '', [{ type: 'char_exclude', value: [[ord('A'), ord('Z')]] }]],
79
+ [
80
+ 'root ::= [^A-Z0-9]',
81
+ '',
82
+ [
83
+ {
84
+ type: 'char_exclude',
85
+ value: [
86
+ [ord('A'), ord('Z')],
87
+ [ord('0'), ord('9')],
88
+ ],
89
+ },
90
+ ],
91
+ ],
92
+ [
93
+ 'root ::= [^A-Z0-9_-]',
94
+ '',
95
+ [{ type: 'char_exclude', value: [[ord('A'), ord('Z')], [ord('0'), ord('9')], ord('_'), ord('-')] }],
96
+ ],
97
+ // expressions
98
+ [
99
+ `
100
+ root ::= foo
101
+ foo ::= "foo"`,
102
+ '',
103
+ [{ type: 'char', value: [ord('f')] }],
104
+ ],
105
+ [
106
+ `root ::= foo
107
+ foo ::= "foo"
108
+ `,
109
+ 'f',
110
+ [{ type: 'char', value: [ord('o')] }],
111
+ ],
112
+ [
113
+ `
114
+ root ::= foo
115
+ foo ::= "foo"
116
+ `,
117
+ 'fo',
118
+ [{ type: 'char', value: [ord('o')] }],
119
+ ],
120
+ [
121
+ `root ::= foo
122
+ foo ::= "foo"`,
123
+ 'foo',
124
+ [{ type: 'end' }],
125
+ ],
126
+ [
127
+ `root ::= f
128
+ f ::= foo
129
+ foo ::= "foo"`,
130
+ '',
131
+ [{ type: 'char', value: [ord('f')] }],
132
+ ],
133
+ // expression and a char rule
134
+ [
135
+ `
136
+ root ::= foo | "bar"
137
+ foo ::= "foo"
138
+ `,
139
+ '',
140
+ [
141
+ { type: 'char', value: [ord('f')] },
142
+ { type: 'char', value: [ord('b')] },
143
+ ],
144
+ ],
145
+ [
146
+ `
147
+ root ::= foo | "bar"
148
+ foo ::= "foo"`,
149
+ 'f',
150
+ [{ type: 'char', value: [ord('o')] }],
151
+ ],
152
+ [
153
+ `root ::= foo | "bar"
154
+ foo ::= "foo"`,
155
+ 'fo',
156
+ [{ type: 'char', value: [ord('o')] }],
157
+ ],
158
+ [
159
+ `root ::= foo | "bar"
160
+ foo ::= "foo"`,
161
+ 'foo',
162
+ [{ type: 'end' }],
163
+ ],
164
+ [
165
+ `root ::= foo | "bar"
166
+ foo ::= "foo"`,
167
+ 'b',
168
+ [{ type: 'char', value: [ord('a')] }],
169
+ ],
170
+ [
171
+ `root ::= foo | "bar"
172
+ foo ::= "foo"`,
173
+ 'ba',
174
+ [{ type: 'char', value: [ord('r')] }],
175
+ ],
176
+ [
177
+ `root ::= foo | "bar"
178
+ foo ::= "foo"`,
179
+ 'bar',
180
+ [{ type: 'end' }],
181
+ ],
182
+ // two expressions
183
+ [
184
+ `
185
+ root ::= foo | bar
186
+ foo ::= "foo"
187
+ bar ::= "bar"`,
188
+ '',
189
+ [
190
+ { type: 'char', value: [ord('f')] },
191
+ { type: 'char', value: [ord('b')] },
192
+ ],
193
+ ],
194
+ [
195
+ `
196
+ root ::= foo | bar
197
+ foo ::= "foo"
198
+ bar ::= "bar"`,
199
+ 'f',
200
+ [{ type: 'char', value: [ord('o')] }],
201
+ ],
202
+ [
203
+ `
204
+ root ::= foo | bar
205
+ foo ::= "foo"
206
+ bar ::= "bar"`,
207
+ 'fo',
208
+ [{ type: 'char', value: [ord('o')] }],
209
+ ],
210
+ [
211
+ `
212
+ root ::= foo | bar
213
+ foo ::= "foo"
214
+ bar ::= "bar"`,
215
+ 'foo',
216
+ [{ type: 'end' }],
217
+ ],
218
+ [
219
+ `
220
+ root ::= foo | bar
221
+ foo ::= "foo"
222
+ bar ::= "bar"`,
223
+ 'b',
224
+ [{ type: 'char', value: [ord('a')] }],
225
+ ],
226
+ [
227
+ `
228
+ root ::= foo | bar
229
+ foo ::= "foo"
230
+ bar ::= "bar"`,
231
+ 'ba',
232
+ [{ type: 'char', value: [ord('r')] }],
233
+ ],
234
+ [
235
+ `
236
+ root ::= foo | bar
237
+ foo ::= "foo"
238
+ bar ::= "bar"`,
239
+ 'bar',
240
+ [{ type: 'end' }],
241
+ ],
242
+ // nested expressions
243
+ [
244
+ `
245
+ root ::= f | b
246
+ f ::= fo
247
+ b ::= ba
248
+ fo ::= foo
249
+ ba ::= bar | baz
250
+ foo ::= "foo"
251
+ bar ::= "bar"
252
+ baz ::= "baz"`,
253
+ '',
254
+ [
255
+ { type: 'char', value: [ord('f')] },
256
+ { type: 'char', value: [ord('b')] },
257
+ ],
258
+ ],
259
+ [
260
+ `
261
+ root ::= f | b
262
+ f ::= fo
263
+ b ::= ba
264
+ fo ::= foo
265
+ ba ::= bar | baz
266
+ foo ::= "foo"
267
+ bar ::= "bar"
268
+ baz ::= "baz"`,
269
+ 'f',
270
+ [{ type: 'char', value: [ord('o')] }],
271
+ ],
272
+ [
273
+ `
274
+ root ::= f | b
275
+ f ::= fo
276
+ b ::= ba
277
+ fo ::= foo
278
+ ba ::= bar | baz
279
+ foo ::= "foo"
280
+ bar ::= "bar"
281
+ baz ::= "baz"`,
282
+ 'fo',
283
+ [{ type: 'char', value: [ord('o')] }],
284
+ ],
285
+ [
286
+ `
287
+ root ::= f | b
288
+ f ::= fo
289
+ b ::= ba
290
+ fo ::= foo
291
+ ba ::= bar | baz
292
+ foo ::= "foo"
293
+ bar ::= "bar"
294
+ baz ::= "baz"`,
295
+ 'foo',
296
+ [{ type: 'end' }],
297
+ ],
298
+ [
299
+ `
300
+ root ::= f | b
301
+ f ::= fo
302
+ b ::= ba
303
+ fo ::= foo
304
+ ba ::= bar | baz
305
+ foo ::= "foo"
306
+ bar ::= "bar"
307
+ baz ::= "baz"`,
308
+ 'b',
309
+ [{ type: 'char', value: [ord('a')] }],
310
+ ],
311
+ [
312
+ `
313
+ root ::= f | b
314
+ f ::= fo
315
+ b ::= ba
316
+ fo ::= foo
317
+ ba ::= bar | baz
318
+ foo ::= "foo"
319
+ bar ::= "bar"
320
+ baz ::= "baz"`,
321
+ 'ba',
322
+ [
323
+ { type: 'char', value: [ord('r')] },
324
+ { type: 'char', value: [ord('z')] },
325
+ ],
326
+ ],
327
+ [
328
+ `
329
+ root ::= f | b
330
+ f ::= fo
331
+ b ::= ba
332
+ fo ::= foo
333
+ ba ::= bar | baz
334
+ foo ::= "foo"
335
+ bar ::= "bar"
336
+ baz ::= "baz"`,
337
+ 'bar',
338
+ [{ type: 'end' }],
339
+ ],
340
+ [
341
+ `
342
+ root ::= f | b
343
+ f ::= fo
344
+ b ::= ba
345
+ fo ::= foo
346
+ ba ::= bar | baz
347
+ foo ::= "foo"
348
+ bar ::= "bar"
349
+ baz ::= "baz"`,
350
+ 'baz',
351
+ [{ type: 'end' }],
352
+ ],
353
+ // ranges
354
+ ['root ::= [a-z]', '', [{ type: 'char', value: [[ord('a'), ord('z')]] }]],
355
+ [
356
+ 'root ::= [a-zA-Z]',
357
+ '',
358
+ [
359
+ {
360
+ type: 'char',
361
+ value: [
362
+ [ord('a'), ord('z')],
363
+ [ord('A'), ord('Z')],
364
+ ],
365
+ },
366
+ ],
367
+ ],
368
+ ['root ::= [a-z]', 'a', [{ type: 'end' }]],
369
+ ['root ::= [a-z]', 'm', [{ type: 'end' }]],
370
+ ['root ::= [a-z]', 'z', [{ type: 'end' }]],
371
+ ['root ::= [a-zA-Z]', 'a', [{ type: 'end' }]],
372
+ ['root ::= [a-zA-Z]', 'Z', [{ type: 'end' }]],
373
+ ['root ::= [a-zA-Z0-9]', 'Z', [{ type: 'end' }]],
374
+ ['root ::= [a-zA-Z0-9]', '0', [{ type: 'end' }]],
375
+ ['root ::= [a-zA-Z0-9]', '9', [{ type: 'end' }]],
376
+ // range with ? modifier
377
+ ['root ::= [a-z]?', '', [{ type: 'char', value: [[ord('a'), ord('z')]] }, { type: 'end' }]],
378
+ ['root ::= [a-z]?', 'a', [{ type: 'end' }]],
379
+ ['root ::= [a-zA-Z]?', 'Z', [{ type: 'end' }]],
380
+ ['root ::= [a-zA-Z0-9]?', '0', [{ type: 'end' }]],
381
+ // range with + modifier
382
+ ['root ::= [a-z]+', '', [{ type: 'char', value: [[ord('a'), ord('z')]] }]],
383
+ ['root ::= [a-z]+', 'l', [{ type: 'char', value: [[ord('a'), ord('z')]] }, { type: 'end' }]],
384
+ [
385
+ 'root ::= [a-zA-Z]+',
386
+ 'Z',
387
+ [
388
+ {
389
+ type: 'char',
390
+ value: [
391
+ [ord('a'), ord('z')],
392
+ [ord('A'), ord('Z')],
393
+ ],
394
+ },
395
+ { type: 'end' },
396
+ ],
397
+ ],
398
+ [
399
+ 'root ::= [a-zA-Z]+',
400
+ 'aZ',
401
+ [
402
+ {
403
+ type: 'char',
404
+ value: [
405
+ [ord('a'), ord('z')],
406
+ [ord('A'), ord('Z')],
407
+ ],
408
+ },
409
+ { type: 'end' },
410
+ ],
411
+ ],
412
+ [
413
+ 'root ::= [a-zA-Z]+',
414
+ 'azAZ',
415
+ [
416
+ {
417
+ type: 'char',
418
+ value: [
419
+ [ord('a'), ord('z')],
420
+ [ord('A'), ord('Z')],
421
+ ],
422
+ },
423
+ { type: 'end' },
424
+ ],
425
+ ],
426
+ // range with * modifier
427
+ ['root ::= [a-z]*', '', [{ type: 'char', value: [[ord('a'), ord('z')]] }, { type: 'end' }]],
428
+ ['root ::= [a-z]*', 'a', [{ type: 'char', value: [[ord('a'), ord('z')]] }, { type: 'end' }]],
429
+ [
430
+ 'root ::= [a-zA-Z]+',
431
+ 'Z',
432
+ [
433
+ {
434
+ type: 'char',
435
+ value: [
436
+ [ord('a'), ord('z')],
437
+ [ord('A'), ord('Z')],
438
+ ],
439
+ },
440
+ { type: 'end' },
441
+ ],
442
+ ],
443
+ [
444
+ 'root ::= [a-zA-Z]+',
445
+ 'abczABCZ',
446
+ [
447
+ {
448
+ type: 'char',
449
+ value: [
450
+ [ord('a'), ord('z')],
451
+ [ord('A'), ord('Z')],
452
+ ],
453
+ },
454
+ { type: 'end' },
455
+ ],
456
+ ],
457
+ // char not with modifiers
458
+ [
459
+ 'root ::= [^f]+ "o"',
460
+ 'aaa',
461
+ [
462
+ { type: 'char_exclude', value: [ord('f')] },
463
+ { type: 'char', value: [ord('o')] },
464
+ ],
465
+ ],
466
+ ['root ::= [^A-Z]+', 'abc', [{ type: 'char_exclude', value: [[ord('A'), ord('Z')]] }, { type: 'end' }]],
467
+ [
468
+ 'root ::= [^A-Z0-9]*',
469
+ 'abc',
470
+ [
471
+ {
472
+ type: 'char_exclude',
473
+ value: [
474
+ [ord('A'), ord('Z')],
475
+ [ord('0'), ord('9')],
476
+ ],
477
+ },
478
+ { type: 'end' },
479
+ ],
480
+ ],
481
+ [
482
+ 'root ::= [^A-Z0-9_-]*',
483
+ 'abc',
484
+ [
485
+ { type: 'char_exclude', value: [[ord('A'), ord('Z')], [ord('0'), ord('9')], ord('_'), ord('-')] },
486
+ { type: 'end' },
487
+ ],
488
+ ],
489
+ // real world bugs
490
+ [
491
+ `
492
+ root ::= [a-z] | xyx
493
+ xyx ::= "foo"`,
494
+ 'f',
495
+ [{ type: 'end' }, { type: 'char', value: [ord('o')] }],
496
+ ],
497
+ // "baz" and "bazaar" are ambiguous, and a string "bazaa" should not result in an 'a' CHAR rule
498
+ ['root ::= "foo" | "bar" | "baz" | "bazaar" | "barrington" ', 'bazaa', [{ type: 'char', value: [ord('r')] }]],
499
+ // should be able to step _into_ a rule, and then continue with the previous rule
500
+ ['root ::= ("bar" | "foo") "zyx"', 'bar', [{ type: 'char', value: [ord('z')] }]],
501
+ // should be able to process a rule, then step _into_ a rule, with a pointer to previous rule
502
+ [
503
+ 'root ::= "z" ("bar" | "foo") "zzzz"',
504
+ 'z',
505
+ [
506
+ { type: 'char', value: [ord('b')] },
507
+ { type: 'char', value: [ord('f')] },
508
+ ],
509
+ ],
510
+ // should be able to process a rule, then step _into_ a rule, and then continue with the previous rule
511
+ ['root ::= "z" ("bar" | "foo") "zzz"', 'zbar', [{ type: 'char', value: [ord('z')] }]],
512
+ [
513
+ `
514
+ root ::= termz ([-+*/] termz)*
515
+ termz ::= [0-9]+`,
516
+ '1',
517
+ [
518
+ { type: 'char', value: [[ord('0'), ord('9')]] },
519
+ { type: 'char', value: [ord('-'), ord('+'), ord('*'), ord('/')] },
520
+ { type: 'end' },
521
+ ],
522
+ ],
523
+ [
524
+ `
525
+ root ::= expr "=" termy
526
+ expr ::= termy ([-+*/] termy)*
527
+ termy ::= [0-9]+`,
528
+ '1',
529
+ [
530
+ { type: 'char', value: [[ord('0'), ord('9')]] },
531
+ { type: 'char', value: [ord('-'), ord('+'), ord('*'), ord('/')] },
532
+ { type: 'char', value: [ord('=')] },
533
+ ],
534
+ ],
535
+ [
536
+ `
537
+ root ::= (expr "=" terma "\n")+
538
+ expr ::= terma ([-+*/] terma)*
539
+ terma ::= [0-9]+`,
540
+ '1',
541
+ [
542
+ { type: 'char', value: [[ord('0'), ord('9')]] },
543
+ { type: 'char', value: [ord('-'), ord('+'), ord('*'), ord('/')] },
544
+ { type: 'char', value: [ord('=')] },
545
+ ],
546
+ ],
547
+ [
548
+ `root ::= (expr "=" termb "\n")+
549
+ expr ::= termb ([-+*/] termb)*
550
+ termb ::= [0-9]+`,
551
+ '1+',
552
+ [{ type: 'char', value: [[ord('0'), ord('9')]] }],
553
+ ],
554
+ [
555
+ `
556
+ root ::= (expr "=" termc "\n")+
557
+ expr ::= termc ([-+*/] termc)*
558
+ termc ::= [0-9]+`,
559
+ '1=',
560
+ [{ type: 'char', value: [[ord('0'), ord('9')]] }],
561
+ ],
562
+ [
563
+ `root ::= (expr "=" termd "\n")+
564
+ expr ::= termd ([-+*/] termd)*
565
+ termd ::= [0-9]+`,
566
+ '1+1',
567
+ [
568
+ { type: 'char', value: [[ord('0'), ord('9')]] },
569
+ { type: 'char', value: [ord('-'), ord('+'), ord('*'), ord('/')] },
570
+ { type: 'char', value: [ord('=')] },
571
+ ],
572
+ ],
573
+ [
574
+ `root ::= (expr "=" term "\n")+
575
+ expr ::= term ([-+*/] term)*
576
+ term ::= [0-9]+`,
577
+ '1=1',
578
+ [
579
+ { type: 'char', value: [[ord('0'), ord('9')]] },
580
+ { type: 'char', value: [ord('\n')] },
581
+ ],
582
+ ],
583
+ [
584
+ 'root ::= "\\"" ( [^\\"abcdefghA-Z])* ',
585
+ "\"is not only in its lyrism, its vow to sustin it in its poo-sion, its r,v:l'y, it's tory,",
586
+ [
587
+ {
588
+ type: 'char_exclude',
589
+ value: [
590
+ ord('"'),
591
+ ord('a'),
592
+ ord('b'),
593
+ ord('c'),
594
+ ord('d'),
595
+ ord('e'),
596
+ ord('f'),
597
+ ord('g'),
598
+ ord('h'),
599
+ [ord('A'), ord('Z')],
600
+ ],
601
+ },
602
+ { type: 'end' },
603
+ ],
604
+ ],
605
+ // sticking to llama.cpp's implementation, for a char_not rule _and_ a char rule
606
+ // side by side, _either_ is valid.
607
+ // that means that input explicitly forbidden by char_not can be allowed by the char
608
+ // rule.
609
+ // it seems weird. but it's the way it is.
610
+ // so below, anything in b-z is allowed, because of the second rule. Anything _not_ a-z is
611
+ // also allowed, because of the first rule. So really the only character disallowed is 'a'.
612
+ [
613
+ 'root ::= ( [^abcdefgh] | [b-z])* ',
614
+ 'bcdefghzyxw0123ABCZ',
615
+ [
616
+ {
617
+ type: 'char_exclude',
618
+ value: [ord('a'), ord('b'), ord('c'), ord('d'), ord('e'), ord('f'), ord('g'), ord('h')],
619
+ },
620
+ { type: 'char', value: [[ord('b'), ord('z')]] },
621
+ { type: 'end' },
622
+ ],
623
+ ],
624
+ ])('it returns parse state for grammar and initial string: %j %j #%#', (grammar, inputString, expected) => {
625
+ let state = GBNF(grammar);
626
+ state = state.add(inputString);
627
+ expect(sortedByJson(state)).toStrictEqual(sortedByJson(expected.map(transformedExpectedDict)));
628
+ });
629
+ });
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/tests/generated/iteration/iteration.test.ts ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { describe, expect, test } from 'vitest';
2
+
3
+ import { GBNF, RuleChar, RuleCharExclude, RuleEnd } from '../../../src/index.js';
4
+
5
+ type Range = [number, number];
6
+
7
+ type ExpectedRule =
8
+ | { type: 'char'; value: (number | Range)[] }
9
+ | { type: 'char_exclude'; value: (number | Range)[] }
10
+ | { type: 'end' };
11
+
12
+ const ord = (char: string): number => char.codePointAt(0) as number;
13
+
14
+ const transformedExpectedDict = (e: ExpectedRule): RuleChar | RuleCharExclude | RuleEnd => {
15
+ if (e.type === 'char') {
16
+ return new RuleChar(e.value);
17
+ } else if (e.type === 'char_exclude') {
18
+ return new RuleCharExclude(e.value);
19
+ } else if (e.type === 'end') {
20
+ return new RuleEnd();
21
+ } else {
22
+ throw new Error(`Unknown type found in expectation array: ${JSON.stringify(e)}`);
23
+ }
24
+ };
25
+
26
+ describe('iteration', () => {
27
+ test.each<[grammar: string, expected: ExpectedRule[]]>([
28
+ // single char rule
29
+ ['root ::= "foo"', [{ type: 'char', value: [ord('f')] }]],
30
+ // two char rules
31
+ [
32
+ 'root ::= "foo" | "bar" ',
33
+ [
34
+ { type: 'char', value: [ord('f')] },
35
+ { type: 'char', value: [ord('b')] },
36
+ ],
37
+ ],
38
+ // three char rules
39
+ [
40
+ 'root ::= "foo" | "bar" | "gaz"',
41
+ [
42
+ { type: 'char', value: [ord('f')] },
43
+ { type: 'char', value: [ord('b')] },
44
+ { type: 'char', value: [ord('g')] },
45
+ ],
46
+ ],
47
+ [
48
+ 'root ::= "foo" | "bar" | "baz"',
49
+ [
50
+ { type: 'char', value: [ord('f')] },
51
+ { type: 'char', value: [ord('b')] },
52
+ ],
53
+ ],
54
+ // char not
55
+ ['root ::= [^x]', [{ type: 'char_exclude', value: [ord('x')] }]],
56
+ ['root ::= [^f] "o"', [{ type: 'char_exclude', value: [ord('f')] }]],
57
+ ['root ::= [^A-Z]', [{ type: 'char_exclude', value: [[ord('A'), ord('Z')]] }]],
58
+ [
59
+ 'root ::= [^A-Z0-9]',
60
+ [
61
+ {
62
+ type: 'char_exclude',
63
+ value: [
64
+ [ord('A'), ord('Z')],
65
+ [ord('0'), ord('9')],
66
+ ],
67
+ },
68
+ ],
69
+ ],
70
+ [
71
+ 'root ::= [^A-Z0-9_-]',
72
+ [{ type: 'char_exclude', value: [[ord('A'), ord('Z')], [ord('0'), ord('9')], ord('_'), ord('-')] }],
73
+ ],
74
+ // expressions
75
+ [
76
+ `
77
+ root ::= foo
78
+ foo ::= "foo"
79
+ `,
80
+ [{ type: 'char', value: [ord('f')] }],
81
+ ],
82
+ [
83
+ `
84
+ root ::= f
85
+ f ::= foo
86
+ foo ::= "foo"
87
+ `,
88
+ [{ type: 'char', value: [ord('f')] }],
89
+ ],
90
+ // expression and a char rule
91
+ [
92
+ `
93
+ root ::= foo | "bar"
94
+ foo ::= "foo"`,
95
+ [
96
+ { type: 'char', value: [ord('f')] },
97
+ { type: 'char', value: [ord('b')] },
98
+ ],
99
+ ],
100
+ // two expressions
101
+ [
102
+ `
103
+ root ::= foo | bar
104
+ foo ::= "foo"
105
+ bar ::= "bar"
106
+ `,
107
+ [
108
+ { type: 'char', value: [ord('f')] },
109
+ { type: 'char', value: [ord('b')] },
110
+ ],
111
+ ],
112
+ // nested expressions
113
+ [
114
+ `
115
+ root ::= f | b
116
+ f ::= fo
117
+ b ::= ba
118
+ fo ::= foo
119
+ ba ::= bar | baz
120
+ foo ::= "foo"
121
+ bar ::= "bar"
122
+ baz ::= "baz"
123
+ `,
124
+ [
125
+ { type: 'char', value: [ord('f')] },
126
+ { type: 'char', value: [ord('b')] },
127
+ ],
128
+ ],
129
+ // ranges
130
+ ['root ::= [a-z]', [{ type: 'char', value: [[ord('a'), ord('z')]] }]],
131
+ [
132
+ 'root ::= [a-zA-Z]',
133
+ [
134
+ {
135
+ type: 'char',
136
+ value: [
137
+ [ord('a'), ord('z')],
138
+ [ord('A'), ord('Z')],
139
+ ],
140
+ },
141
+ ],
142
+ ],
143
+ // range with ? modifier
144
+ ['root ::= [a-z]?', [{ type: 'char', value: [[ord('a'), ord('z')]] }, { type: 'end' }]],
145
+ // range with + modifier
146
+ ['root ::= [a-z]+', [{ type: 'char', value: [[ord('a'), ord('z')]] }]],
147
+ // range with * modifier
148
+ ['root ::= [a-z]*', [{ type: 'char', value: [[ord('a'), ord('z')]] }, { type: 'end' }]],
149
+ // rules that aren't used are silently ignored
150
+ [
151
+ `
152
+ root ::= "foo"
153
+ foo ::= "foo"`,
154
+ [{ type: 'char', value: [ord('f')] }],
155
+ ],
156
+ // real world use cases
157
+ // arithmetic
158
+ [
159
+ `
160
+ root ::= (expr "=" term "\
161
+ ")+
162
+ expr ::= term ([-+*/] term)*
163
+ term ::= [0-9]+
164
+ `,
165
+ [{ type: 'char', value: [[ord('0'), ord('9')]] }],
166
+ ],
167
+ ])('it returns parse state for grammar: %j #%#', (grammar, expected) => {
168
+ const state = [...GBNF(grammar)];
169
+ expect(state).toStrictEqual(expected.map(transformedExpectedDict));
170
+ });
171
+ });
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/tests/generated/validation/validate-grammar.test.ts ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { describe, expect, test } from 'vitest';
2
+
3
+ import { GBNF, GrammarParseError } from '../../../src/index.js';
4
+
5
+ describe('validate grammar', () => {
6
+ test.each([
7
+ 'root ::= "foo"',
8
+ 'root ::= "foo" | "bar"',
9
+ 'root ::= ("foo" | "bar")',
10
+ 'root ::= ("foo" | "bar")?',
11
+ 'root ::= ("foo" | "bar")*',
12
+ 'root ::= ("foo" | "bar")+',
13
+ 'root ::= [a-z]',
14
+ 'root ::= [a-zA-Z]',
15
+ 'root ::= [a-zA-Z0-9]',
16
+ 'root ::= [a-zA-Z0-9]*',
17
+ 'root ::= [a-zA-Z0-9]?',
18
+ 'root ::= [a-z]+',
19
+ 'root ::= [a-zA-Z0-9]+',
20
+ 'root ::= ([a-zA-Z0-9])*',
21
+ 'root ::= ([a-zA-Z0-9])?',
22
+ 'root ::= ([a-zA-Z0-9])+',
23
+ `
24
+ root ::= foo
25
+ foo ::= "foo"`,
26
+ `
27
+ root ::= foo
28
+ foo ::= "foo" | "bar" | ([a-z])?
29
+ `,
30
+ ])('it parses a grammar: %j', (grammar) => {
31
+ GBNF(grammar);
32
+ });
33
+
34
+ test.each<[grammar: string, errorPos: number, errorReason: string]>([
35
+ ['', 0, 'No rules were found'],
36
+ ['root = "foo"', 5, 'Expecting ::= at 5'],
37
+ [
38
+ `root ::= foo
39
+ foo := "foo"
40
+ `,
41
+ 17,
42
+ 'Expecting ::= at 17',
43
+ ],
44
+ ['root ::= foo', 9, 'Undefined rule identifier "foo"'],
45
+ [
46
+ `root ::= foo
47
+ bar ::= "bar"
48
+ `,
49
+ 9,
50
+ 'Undefined rule identifier "foo"',
51
+ ],
52
+ [
53
+ `root ::= foo
54
+ foo ::= baz
55
+ bar ::= "bar"
56
+ `,
57
+ 21,
58
+ 'Undefined rule identifier "baz"',
59
+ ],
60
+ ['root ::= foo ::= bar', 13, 'Expecting newline or end at 13'],
61
+ [
62
+ `root ::= ([a-z]
63
+ foo ::= "foo"
64
+ `,
65
+ 20,
66
+ "Expecting ')' at 20",
67
+ ],
68
+ ])('it reports an error for an invalid grammar: %j', (grammar, errorPos, errorReason) => {
69
+ const expected = new GrammarParseError(grammar, errorPos, errorReason);
70
+ let e: unknown;
71
+ try {
72
+ GBNF(grammar);
73
+ } catch (err) {
74
+ e = err;
75
+ }
76
+ expect(e).toBeInstanceOf(GrammarParseError);
77
+ expect((e as GrammarParseError).equals(expected)).toBe(true);
78
+ });
79
+ });
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/tests/generated/validation/validate-input.test.ts ADDED
@@ -0,0 +1,319 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { describe, expect, test } from 'vitest';
2
+
3
+ import { GBNF, InputParseError } from '../../../src/index.js';
4
+
5
+ describe('validate input', () => {
6
+ test.each<[grammar: string, input: string]>([['root ::= "foo"', 'f']])(
7
+ 'it parses a grammar: %j %j',
8
+ (grammar, input) => {
9
+ const graph = GBNF(grammar, input);
10
+ expect(Boolean(graph)).toBe(true);
11
+ },
12
+ );
13
+
14
+ test.each<[grammar: string, inputText: string, errorPos: number]>([
15
+ ['root ::= "foo"', '2', 0],
16
+ ['root ::= "foo"', 'b', 0],
17
+ ['root ::= "foo"', 'f1', 1],
18
+ ['root ::= "foo"', 'fo1', 2],
19
+ ['root ::= "foo"', 'fooo', 3],
20
+ ['root ::= "foo"', 'fooooooo', 3],
21
+ ['root ::= "foo" | "bar"', '1', 0],
22
+ ['root ::= "foo" | "bar"', 'z', 0],
23
+ ['root ::= "foo" | "bar"', 'f1', 1],
24
+ ['root ::= "foo" | "bar"', 'b1', 1],
25
+ ['root ::= "foo" | "bar"', 'fo1', 2],
26
+ ['root ::= "foo" | "bar"', 'ba1', 2],
27
+ ['root ::= "foo" | "bar"', 'fooo', 3],
28
+ ['root ::= "foo" | "bar"', 'barrr', 3],
29
+ ['root ::= "foo" | "bar" | "baz"', '1', 0],
30
+ ['root ::= "foo" | "bar" | "baz"', 'z', 0],
31
+ ['root ::= "foo" | "bar" | "baz"', 'f1', 1],
32
+ ['root ::= "foo" | "bar" | "baz"', 'b1', 1],
33
+ ['root ::= "foo" | "bar" | "baz"', 'fo1', 2],
34
+ ['root ::= "foo" | "bar" | "baz"', 'bal', 2],
35
+ ['root ::= "foo" | "bar" | "baz"', 'fooo', 3],
36
+ ['root ::= "foo" | "bar" | "baz"', 'bazrr', 3],
37
+ ['root ::= [^a]', 'a', 0],
38
+ ['root ::= [^abc]', 'b', 0],
39
+ ['root ::= [^a-z]', 'z', 0],
40
+ ['root ::= [^a-zA-Z]', 'X', 0],
41
+ ['root ::= [^a-zA-Z0-9]', '8', 0],
42
+ [
43
+ `
44
+ root ::= foo
45
+ foo ::= "foo"`,
46
+ '1',
47
+ 0,
48
+ ],
49
+ [
50
+ `
51
+ root ::= foo
52
+ foo ::= "foo"`,
53
+ 'b',
54
+ 0,
55
+ ],
56
+ [
57
+ `
58
+ root ::= foo
59
+ foo ::= "foo"`,
60
+ 'f1',
61
+ 1,
62
+ ],
63
+ [
64
+ `
65
+ root ::= foo
66
+ foo ::= "foo"`,
67
+ 'fo1',
68
+ 2,
69
+ ],
70
+ [
71
+ `
72
+ root ::= foo
73
+ foo ::= "foo"`,
74
+ 'fooo',
75
+ 3,
76
+ ],
77
+ [
78
+ `
79
+ root::=foo|"bar"
80
+ foo::="foo"`,
81
+ '1',
82
+ 0,
83
+ ],
84
+ [
85
+ `
86
+ root::=foo|"bar"
87
+ foo::="foo"`,
88
+ 'z',
89
+ 0,
90
+ ],
91
+ [
92
+ `
93
+ root::=foo|"bar"
94
+ foo::="foo"`,
95
+ 'f1',
96
+ 1,
97
+ ],
98
+ [
99
+ `
100
+ root::=foo|"bar"
101
+ foo::="foo"`,
102
+ 'b1',
103
+ 1,
104
+ ],
105
+ [
106
+ `
107
+ root::=foo|"bar"
108
+ foo::="foo"`,
109
+ 'fo1',
110
+ 2,
111
+ ],
112
+ [
113
+ `
114
+ root::=foo|"bar"
115
+ foo::="foo"`,
116
+ 'fooo',
117
+ 3,
118
+ ],
119
+ [
120
+ `
121
+ root::=foo|"bar"
122
+ foo::="foo"`,
123
+ 'barr',
124
+ 3,
125
+ ],
126
+ [
127
+ `
128
+ root::= foo | bar
129
+ foo::="foo"
130
+ bar::="bar"`,
131
+ '1',
132
+ 0,
133
+ ],
134
+ [
135
+ `
136
+ root::= foo | bar
137
+ foo::="foo"
138
+ bar::="bar"`,
139
+ 'z',
140
+ 0,
141
+ ],
142
+ [
143
+ `
144
+ root::= foo | bar
145
+ foo::="foo"
146
+ bar::="bar"`,
147
+ 'f1',
148
+ 1,
149
+ ],
150
+ [
151
+ `
152
+ root::= foo | bar
153
+ foo::="foo"
154
+ bar::="bar"`,
155
+ 'b1',
156
+ 1,
157
+ ],
158
+ [
159
+ `
160
+ root::= foo | bar
161
+ foo::="foo"
162
+ bar::="bar"`,
163
+ 'fo1',
164
+ 2,
165
+ ],
166
+ [
167
+ `
168
+ root::= foo | bar
169
+ foo::="foo"
170
+ bar::="bar"`,
171
+ 'fooo',
172
+ 3,
173
+ ],
174
+ [
175
+ `
176
+ root::= foo | bar
177
+ foo::="foo"
178
+ bar::="bar"`,
179
+ 'barr',
180
+ 3,
181
+ ],
182
+ [
183
+ `
184
+ root ::= f | b
185
+ f ::= fo
186
+ b ::= ba
187
+ fo ::= foo
188
+ ba ::= bar | baz
189
+ foo ::= "foo"
190
+ bar ::= "bar"
191
+ baz ::= "baz"
192
+ `,
193
+ '1',
194
+ 0,
195
+ ],
196
+ [
197
+ `
198
+ root ::= f | b
199
+ f ::= fo
200
+ b ::= ba
201
+ fo ::= foo
202
+ ba ::= bar | baz
203
+ foo ::= "foo"
204
+ bar ::= "bar"
205
+ baz ::= "baz"`,
206
+ 'z',
207
+ 0,
208
+ ],
209
+ [
210
+ `
211
+ root ::= f | b
212
+ f ::= fo
213
+ b ::= ba
214
+ fo ::= foo
215
+ ba ::= bar | baz
216
+ foo ::= "foo"
217
+ bar ::= "bar"
218
+ baz ::= "baz"`,
219
+ 'f1',
220
+ 1,
221
+ ],
222
+ [
223
+ `
224
+ root ::= f | b
225
+ f ::= fo
226
+ b ::= ba
227
+ fo ::= foo
228
+ ba ::= bar | baz
229
+ foo ::= "foo"
230
+ bar ::= "bar"
231
+ baz ::= "baz"`,
232
+ 'b1',
233
+ 1,
234
+ ],
235
+ [
236
+ `
237
+ root ::= f | b
238
+ f ::= fo
239
+ b ::= ba
240
+ fo ::= foo
241
+ ba ::= bar | baz
242
+ foo ::= "foo"
243
+ bar ::= "bar"
244
+ baz ::= "baz"`,
245
+ 'fo1',
246
+ 2,
247
+ ],
248
+ [
249
+ `
250
+ root ::= f | b
251
+ f ::= fo
252
+ b ::= ba
253
+ fo ::= foo
254
+ ba ::= bar | baz
255
+ foo ::= "foo"
256
+ bar ::= "bar"
257
+ baz ::= "baz"`,
258
+ 'fooo',
259
+ 3,
260
+ ],
261
+ [
262
+ `
263
+ root ::= f | b
264
+ f ::= fo
265
+ b ::= ba
266
+ fo ::= foo
267
+ ba ::= bar | baz
268
+ foo ::= "foo"
269
+ bar ::= "bar"
270
+ baz ::= "baz"`,
271
+ 'barr',
272
+ 3,
273
+ ],
274
+ [
275
+ `
276
+ root ::= f | b
277
+ f ::= fo
278
+ b ::= ba
279
+ fo ::= foo
280
+ ba ::= bar | baz
281
+ foo ::= "foo"
282
+ bar ::= "bar"
283
+ baz ::= "baz"`,
284
+ 'bazr',
285
+ 3,
286
+ ],
287
+ ['root ::= [a-z]', 'A', 0],
288
+ ['root ::= [a-z]', '0', 0],
289
+ ['root ::= [a-z]', 'az', 1],
290
+ ['root ::= [a-z]?', 'A', 0],
291
+ ['root ::= [a-z]?', '0', 0],
292
+ ['root ::= [a-z]?', 'az', 1],
293
+ ['root ::= [a-z]+', 'A', 0],
294
+ ['root ::= [a-z]+', '0', 0],
295
+ ['root ::= [a-z]+', 'az0', 2],
296
+ ['root ::= [a-z]*', 'A', 0],
297
+ ['root ::= [a-z]*', '0', 0],
298
+ ['root ::= [a-z]*', 'az0', 2],
299
+ // sticking to llama.cpp's implementation, for a char_not rule _and_ a char rule
300
+ // side by side, _either_ is valid.
301
+ // that means that input explicitly forbidden by char_not can be allowed by the char
302
+ // rule.
303
+ // it seems weird. but it's the way it is.
304
+ // so below, anything in b-z is allowed, because of the second rule. Anything _not_ a-z is
305
+ // also allowed, because of the first rule. So really the only character disallowed is 'a'.
306
+ ['root ::= ( [^abcdefgh] | [b-z])*', 'a', 0],
307
+ ])('it reports an error for an invalid input: %j %j %j', (grammar, inputText, errorPos) => {
308
+ const graph = GBNF(grammar);
309
+ const expected = new InputParseError(inputText, errorPos);
310
+ let e: unknown;
311
+ try {
312
+ graph.add(inputText);
313
+ } catch (err) {
314
+ e = err;
315
+ }
316
+ expect(e).toBeInstanceOf(InputParseError);
317
+ expect((e as InputParseError).equals(expected)).toBe(true);
318
+ });
319
+ });
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/tsconfig.build.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "noEmit": false,
5
+ "declaration": true,
6
+ "sourceMap": true,
7
+ "rootDir": "src",
8
+ "outDir": "dist"
9
+ },
10
+ "include": ["src"],
11
+ "exclude": ["src/**/*.test.ts"]
12
+ }
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/tsconfig.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "lib": ["ES2022"],
5
+ "module": "NodeNext",
6
+ "moduleResolution": "NodeNext",
7
+ "strict": true,
8
+ "isolatedModules": true,
9
+ "esModuleInterop": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "skipLibCheck": true,
12
+ "noEmit": true
13
+ },
14
+ "include": ["src", "tests", "vitest.config.ts"]
15
+ }
v2-models-effort/runs/20261111-214430-dark-sunset/ported_implementation/vitest.config.ts ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ import { defineConfig } from 'vitest/config';
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ // unit tests are colocated with the implementation, integration tests live in tests/generated
6
+ include: ['src/**/*.test.ts', 'tests/**/*.test.ts'],
7
+ },
8
+ });
v2-models-effort/runs/20261111-214430-dark-sunset/proxy.log ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ NOTICE Nov 11 23:51:21.480 [8]: Initializing tinyproxy ...
2
+ NOTICE Nov 11 23:51:21.480 [8]: Reloading config file (/etc/tinyproxy/tinyproxy.conf)
3
+ INFO Nov 11 23:51:21.480 [8]: Added address [127.0.0.1] to listen addresses.
4
+ INFO Nov 11 23:51:21.480 [8]: Adding Port [443] to the list allowed by CONNECT
5
+ NOTICE Nov 11 23:51:21.480 [8]: Reloading config file finished
6
+ INFO Nov 11 23:51:21.480 [8]: listen_sock called with addr = '127.0.0.1'
7
+ INFO Nov 11 23:51:21.480 [8]: trying to listen on host[127.0.0.1], family[2], socktype[1], proto[6]
8
+ INFO Nov 11 23:51:21.480 [8]: listening on fd [3]
9
+ INFO Nov 11 23:51:21.480 [8]: Not running as root, so not changing UID/GID.
10
+ INFO Nov 11 23:51:21.480 [8]: Setting the various signals.
11
+ INFO Nov 11 23:51:21.480 [8]: Starting main loop. Accepting connections.
12
+ botbox-proxy: listening
13
+ CONNECT Nov 11 23:51:22.412 [8]: Connect (file descriptor 4): 127.0.0.1
14
+ CONNECT Nov 11 23:51:22.412 [8]: Request (file descriptor 4): CONNECT api.anthropic.com:443 HTTP/1.1
15
+ NOTICE Nov 11 23:51:22.412 [8]: Proxying refused on filtered url "api.anthropic.com:443"
v2-models-effort/runs/20261111-214430-dark-sunset/result.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"duration_api_ms":8417203,"stop_reason":"end_turn","session_id":"90097121-4ffa-470f-8563-1c842390b95d","total_cost_usd":25.63832480000001,"usage":{"input_tokens":424,"cache_creation_input_tokens":1053443,"cache_read_input_tokens":21455335,"output_tokens":503848,"output_tokens_details":{"thinking_tokens":372309},"server_tool_use":{"web_search_requests":0,"web_fetch_requests":0},"service_tier":"standard","cache_creation":{"ephemeral_1h_input_tokens":1053443,"ephemeral_5m_input_tokens":0},"inference_geo":"global","iterations":[],"speed":"standard","fallback_credit":null},"modelUsage":{"claude-fable-5-2":{"inputTokens":31937,"outputTokens":632271,"cacheReadInputTokens":22318929,"cacheCreationInputTokens":1057167,"webSearchRequests":0,"costUSD":25.63832480000001,"contextWindow":200000,"maxOutputTokens":32000,"thinkingTokens":372309,"canonicalModel":"claude-fable-5-2","provider":"firstParty","costBasis":"unknown"}},"permission_denials":[],"terminal_reason":"completed","fast_mode_state":"off","fast_mode_disabled_reason":"sdk_opt_in_required","subagent_stats":{"spawned":0,"requested":{"background":0,"foreground":0,"unset":0},"started_in_background":0,"max_depth":0,"spawned_by_subagents":0,"completed":0,"failed":0,"killed":{"parent":0,"user":0,"system":0},"refused":{"depth_limit":0,"concurrency_limit":0,"budget":0},"by_type":{}},"safety_stops":0,"is_error":false,"num_turns":308,"subtype":"success","api_error_status":null,"result":"The port is complete in `/target`: the full `gbnf` implementation in TypeScript, plus all 510 reference tests in 27 files (pytest collects the same 510 from the reference). `vitest run` in `/target` passes 27 files / 510 tests using the globally installed vitest, with no install step.\n\n**No compiler type check was run.** There is no `tsc` anywhere in the sandbox, so `npm run typecheck` and `npm run build` are untested. In its place I reviewed every implementation and test file by hand against strict mode and found no errors, and Node's own type stripper accepts all 64 `.ts` files.\n\nBeyond the ported tests, I ran about 130,000 randomized jobs through both the Python reference and the port (random and mutated grammars, grammar-guided inputs, escape-sequence probes, error formatting). There were no unexplained differences.\n\n## Deliberate differences from the reference\n\n- **Grammar without a `root` rule:** the port throws `GrammarParseError` (\"Grammar does not contain a 'root' symbol\"). The Python code intends this but actually raises `KeyError: 'root'`.\n- **Rule order:** a parse state yields rules in grammar-walk order. The reference keeps alternatives in a `set`, so its order varies between runs; the ported integration tests compare order-insensitively, as the reference tests do.\n- **Graph printing:** the reference crashes with an `AttributeError` when printing a real graph; the port reproduces this as a `TypeError` with the same message rather than fixing it.\n- **Unicode version:** Node 24 and Python 3.14 ship different Unicode versions, so very recently assigned characters could be classified differently in escapes and `repr`-style output. I did not see this in testing.\n\n## API mapping\n\n- **Operators:** `state + text` becomes `state.add(text)`; `state(text)` still works because a parse state is callable.\n- **Dunder methods:** `==` becomes `.equals()`, `repr()` becomes `.toString()`, and `__dict__` becomes `.toJSON()`.\n- **Exceptions:** `ValueError` becomes `Error`, `IndexError` becomes `RangeError`, and `AttributeError` becomes `TypeError`, all with the same messages.\n- **Positions:** all offsets are counted in code points, so error positions match Python's.\n\n`README.md` documents usage and these differences. `package.json` declares no dependencies or devDependencies, so running the tests elsewhere needs vitest (and `tsc` for the build scripts) installed separately.","ttft_ms":1124,"type":"result","duration_ms":8548797,"uuid":"37bfbb9c-8e29-4a4a-8b77-91de03568ace","ttft_stream_ms":498,"time_to_request_ms":53,"first_content_frame_ms":498,"queued_turn_count":0,"result_index":0}
v2-models-effort/runs/20261111-214430-dark-sunset/run.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "params": {
3
+ "source-language": "python",
4
+ "model": "claude-fable-5-2",
5
+ "effort": "max"
6
+ },
7
+ "command": "uv run --project packages/gbnf_experiment run_gbnf_experiment --include-unit-tests 1 --include-source-integration-tests 1 --include-target-integration-tests 0 --output /home/duncan/work/code/research/ports/experiments/v2-models-effort/runs/20261111-214430-dark-sunset --source-language python --model claude-fable-5-2 --effort max --auth subscription --memory 24g",
8
+ "created": "2026-11-11T23:51:03Z",
9
+ "ended": "2026-11-12T02:13:52Z",
10
+ "exit_code": 0,
11
+ "error": null,
12
+ "ended_by": null,
13
+ "signal": null,
14
+ "git": {
15
+ "commit": "8422439f49db061ed5b56e9b883ef244807898f8",
16
+ "dirty": true
17
+ },
18
+ "labnotes_version": "0.2.39.dev138",
19
+ "labnotes_command": "labnotes experiments v2-models-effort run --concurrency 1 --model=claude-fable-5-2 -- --auth subscription --memory 24g",
20
+ "args": [
21
+ "--auth",
22
+ "subscription",
23
+ "--memory",
24
+ "24g"
25
+ ],
26
+ "pid": 2512298,
27
+ "pid_created": 1794441063.77
28
+ }
v2-models-effort/runs/20261111-214430-dark-sunset/run.lock ADDED
File without changes
v2-models-effort/runs/20261111-214430-dark-sunset/stderr.log ADDED
File without changes
v2-models-effort/runs/20261111-214430-dark-sunset/stderr.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ [claude-code:unrecognized_model] {"model":"claude-fable-5-2","query_source":"sdk"}
v2-models-effort/runs/20261111-214430-dark-sunset/stdout.log ADDED
@@ -0,0 +1 @@
 
 
1
+ *** auth: subscription ***
v2-models-effort/runs/20261111-214430-dark-sunset/transcript/.claude/projects/-target/90097121-4ffa-470f-8563-1c842390b95d.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
v2-models-effort/runs/20261111-214430-flat-disk/credentials.log ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [2026-11-11 22:45:12.905][22][warning][main] [source/server/server.cc:1012] There is no configured limit to the number of allowed active downstream connections. Configure a limit in `envoy.resource_monitors.global_downstream_max_connections` resource monitor.
2
+ [2026-11-11T22:45:13.532Z] POST /v1/messages?beta=true 200 - 2790ms
3
+ [2026-11-11T22:45:16.349Z] POST /v1/messages?beta=true 200 - 1246ms
4
+ [2026-11-11T22:45:17.631Z] POST /v1/messages?beta=true 200 - 3511ms
5
+ [2026-11-11T22:45:21.169Z] POST /v1/messages?beta=true 200 - 3883ms
6
+ [2026-11-11T22:45:25.084Z] POST /v1/messages?beta=true 200 - 20617ms
7
+ [2026-11-11T22:45:45.723Z] POST /v1/messages?beta=true 200 - 34272ms
8
+ [2026-11-11T22:46:20.022Z] POST /v1/messages?beta=true 200 - 9026ms
9
+ [2026-11-11T22:46:29.068Z] POST /v1/messages?beta=true 200 - 4181ms
10
+ [2026-11-11T22:46:33.263Z] POST /v1/messages?beta=true 200 - 297124ms
11
+ [2026-11-11T22:51:30.420Z] POST /v1/messages?beta=true 200 - 4966ms
12
+ [2026-11-11T22:51:35.402Z] POST /v1/messages?beta=true 200 - 16059ms
13
+ [2026-11-11T22:51:51.479Z] POST /v1/messages?beta=true 200 - 3153ms
14
+ [2026-11-11T22:51:54.662Z] POST /v1/messages?beta=true 200 - 3461ms
15
+ [2026-11-11T22:51:58.145Z] POST /v1/messages?beta=true 200 - 311412ms
16
+ [2026-11-11T22:57:09.580Z] POST /v1/messages?beta=true 200 - 4071ms
17
+ [2026-11-11T22:57:14.195Z] POST /v1/messages?beta=true 200 - 2730ms
18
+ [2026-11-11T22:57:16.957Z] POST /v1/messages?beta=true 200 - 3114ms
19
+ [2026-11-11T22:57:20.104Z] POST /v1/messages?beta=true 200 - 266842ms
20
+ [2026-11-11T23:01:47.161Z] POST /v1/messages?beta=true 200 - 10808ms
21
+ [2026-11-11T23:01:58.010Z] POST /v1/messages?beta=true 200 - 31007ms
22
+ [2026-11-11T23:02:29.053Z] POST /v1/messages?beta=true 200 DC 428040ms
23
+ [2026-11-11T23:09:37.101Z] POST /v1/messages?beta=true 200 - 99577ms
24
+ [2026-11-11T23:11:16.694Z] POST /v1/messages/count_tokens?beta=true 200 - 102ms
25
+ [2026-11-11T23:11:16.826Z] POST /v1/messages?beta=true 200 - 7232ms
26
+ [2026-11-11T23:11:24.090Z] POST /v1/messages?beta=true 200 - 2279ms
27
+ [2026-11-11T23:11:26.396Z] POST /v1/messages?beta=true 200 - 10669ms
28
+ [2026-11-11T23:11:37.076Z] POST /v1/messages?beta=true 200 - 15498ms
29
+ [2026-11-11T23:11:52.607Z] POST /v1/messages?beta=true 200 - 4320ms
30
+ [2026-11-11T23:11:56.951Z] POST /v1/messages?beta=true 200 - 12222ms
31
+ [2026-11-11T23:12:09.192Z] POST /v1/messages?beta=true 200 - 3377ms
32
+ [2026-11-11T23:12:12.585Z] POST /v1/messages?beta=true 200 - 12234ms
33
+ [2026-11-11T23:12:24.834Z] POST /v1/messages?beta=true 200 - 22365ms
34
+ [2026-11-11T23:12:47.214Z] POST /v1/messages?beta=true 200 - 2718ms
35
+ [2026-11-11T23:12:49.948Z] POST /v1/messages?beta=true 200 - 8238ms
36
+ [2026-11-11T23:12:58.203Z] POST /v1/messages?beta=true 200 - 19003ms
37
+ [2026-11-11T23:13:17.231Z] POST /v1/messages?beta=true 200 - 63990ms
38
+ [2026-11-11T23:14:21.250Z] POST /v1/messages?beta=true 200 - 18851ms
39
+ [2026-11-11T23:14:40.231Z] POST /v1/messages?beta=true 200 - 6798ms
40
+ [2026-11-11T23:14:47.058Z] POST /v1/messages?beta=true 200 - 65455ms
41
+ [2026-11-11T23:15:52.621Z] POST /v1/messages?beta=true 200 - 185723ms
42
+ [2026-11-11T23:18:58.375Z] POST /v1/messages?beta=true 200 - 17077ms
43
+ [2026-11-11T23:19:15.478Z] POST /v1/messages?beta=true 200 - 31246ms
44
+ [2026-11-11T23:19:46.752Z] POST /v1/messages?beta=true 200 - 27594ms
45
+ [2026-11-11T23:20:14.367Z] POST /v1/messages?beta=true 200 - 41887ms
46
+ [2026-11-11T23:20:56.283Z] POST /v1/messages?beta=true 200 - 33182ms
47
+ [2026-11-11T23:21:30.173Z] POST /v1/messages?beta=true 200 - 4300ms
48
+ [2026-11-11T23:21:34.998Z] POST /v1/messages?beta=true 200 - 13874ms
49
+ [2026-11-11T23:21:48.892Z] POST /v1/messages?beta=true 200 - 25577ms
50
+ [2026-11-11T23:22:14.502Z] POST /v1/messages?beta=true 200 - 11117ms
51
+ [2026-11-11T23:22:25.647Z] POST /v1/messages?beta=true 200 - 53729ms
52
+ [2026-11-11T23:23:19.424Z] POST /v1/messages?beta=true 200 - 125790ms
53
+ [2026-11-11T23:25:25.222Z] POST /v1/messages/count_tokens?beta=true 200 - 91ms
54
+ [2026-11-11T23:25:25.344Z] POST /v1/messages?beta=true 200 - 2669ms
55
+ [2026-11-11T23:25:28.033Z] POST /v1/messages?beta=true 200 - 7580ms
56
+ [2026-11-11T23:25:35.635Z] POST /v1/messages?beta=true 200 - 3728ms
57
+ [2026-11-11T23:25:39.381Z] POST /v1/messages?beta=true 200 - 13411ms
58
+ [2026-11-11T23:25:52.805Z] POST /v1/messages?beta=true 200 - 13454ms
59
+ [2026-11-11T23:26:06.276Z] POST /v1/messages?beta=true 200 - 19375ms
60
+ [2026-11-11T23:26:25.674Z] POST /v1/messages?beta=true 200 - 10805ms
61
+ [2026-11-11T23:26:37.037Z] POST /v1/messages?beta=true 200 - 5636ms
62
+ [2026-11-11T23:26:42.703Z] POST /v1/messages?beta=true 200 - 23585ms
63
+ [2026-11-11T23:27:06.779Z] POST /v1/messages?beta=true 200 - 2478ms
64
+ [2026-11-11T23:27:09.273Z] POST /v1/messages?beta=true 200 - 21619ms
65
+ [2026-11-11T23:27:31.393Z] POST /v1/messages?beta=true 200 - 3375ms
66
+ [2026-11-11T23:27:34.786Z] POST /v1/messages?beta=true 200 - 2715ms
67
+ [2026-11-11T23:27:37.524Z] POST /v1/messages?beta=true 200 - 3570ms
68
+ [2026-11-11T23:27:41.636Z] POST /v1/messages?beta=true 200 - 7579ms
69
+ [2026-11-11T23:27:49.237Z] POST /v1/messages?beta=true 200 - 2393ms
70
+ [2026-11-11T23:27:51.655Z] POST /v1/messages?beta=true 200 - 7721ms
71
+ [2026-11-11T23:27:59.408Z] POST /v1/messages?beta=true 200 - 4095ms
72
+ [2026-11-11T23:28:04.145Z] POST /v1/messages?beta=true 200 - 2451ms
73
+ [2026-11-11T23:28:07.137Z] POST /v1/messages?beta=true 200 - 14150ms
74
+ [2026-11-11T23:28:21.304Z] POST /v1/messages?beta=true 200 - 67754ms
75
+ [2026-11-11T23:29:29.077Z] POST /v1/messages?beta=true 200 - 19797ms
76
+ [2026-11-11T23:29:50.306Z] POST /v1/messages?beta=true 200 - 19971ms
77
+ [2026-11-11T23:30:11.286Z] POST /v1/messages?beta=true 200 - 6852ms
78
+ [2026-11-11T23:30:18.667Z] POST /v1/messages?beta=true 200 - 29408ms
79
+ [2026-11-11T23:30:48.632Z] POST /v1/messages?beta=true 200 - 5382ms
80
+ [2026-11-11T23:30:54.030Z] POST /v1/messages?beta=true 200 - 4107ms
81
+ [2026-11-11T23:30:58.150Z] POST /v1/messages?beta=true 200 - 37501ms
82
+ [2026-11-11T23:31:36.147Z] POST /v1/messages?beta=true 200 - 5122ms
83
+ [2026-11-11T23:31:41.284Z] POST /v1/messages?beta=true 200 - 24961ms
84
+ [2026-11-11T23:32:06.743Z] POST /v1/messages?beta=true 200 - 2939ms
85
+ [2026-11-11T23:32:09.697Z] POST /v1/messages?beta=true 200 - 39611ms
86
+ [2026-11-11T23:32:49.815Z] POST /v1/messages?beta=true 200 - 1968ms
87
+ [2026-11-11T23:32:51.802Z] POST /v1/messages?beta=true 200 - 17384ms
88
+ [2026-11-11T23:33:09.682Z] POST /v1/messages?beta=true 200 - 7069ms
89
+ [2026-11-11T23:33:16.768Z] POST /v1/messages?beta=true 200 - 6126ms
90
+ [2026-11-11T23:33:22.941Z] POST /v1/messages?beta=true 200 - 92855ms
91
+ [2026-11-11T23:34:55.804Z] POST /v1/messages/count_tokens?beta=true 200 - 91ms
92
+ [2026-11-11T23:34:55.805Z] POST /v1/messages/count_tokens?beta=true 200 - 186ms
93
+ [2026-11-11T23:34:56.025Z] POST /v1/messages?beta=true 200 - 3227ms
94
+ [2026-11-11T23:34:59.272Z] POST /v1/messages?beta=true 200 - 19210ms
95
+ [2026-11-11T23:35:18.497Z] POST /v1/messages?beta=true 200 - 5043ms
96
+ [2026-11-11T23:35:23.553Z] POST /v1/messages?beta=true 200 - 20934ms
97
+ [2026-11-11T23:35:45.082Z] POST /v1/messages?beta=true 200 - 5245ms
98
+ [2026-11-11T23:35:50.348Z] POST /v1/messages?beta=true 200 - 2421ms
99
+ [2026-11-11T23:35:52.788Z] POST /v1/messages?beta=true 200 - 3649ms
100
+ [2026-11-11T23:35:56.449Z] POST /v1/messages?beta=true 200 - 5022ms
101
+ [2026-11-11T23:36:01.488Z] POST /v1/messages?beta=true 200 - 13456ms
102
+ [2026-11-11T23:36:14.977Z] POST /v1/messages?beta=true 200 - 3507ms
103
+ [2026-11-11T23:36:18.504Z] POST /v1/messages?beta=true 200 - 6672ms
104
+ [2026-11-11T23:36:25.188Z] POST /v1/messages?beta=true 200 - 1953ms
105
+ [2026-11-11T23:36:27.157Z] POST /v1/messages?beta=true 200 - 10889ms
106
+ [2026-11-11T23:36:38.062Z] POST /v1/messages?beta=true 200 - 6143ms
107
+ [2026-11-11T23:36:44.293Z] POST /v1/messages?beta=true 200 - 3302ms
108
+ [2026-11-11T23:36:48.130Z] POST /v1/messages?beta=true 200 - 7574ms
109
+ [2026-11-11T23:36:56.323Z] POST /v1/messages?beta=true 200 - 10289ms
110
+ [2026-11-11T23:37:07.219Z] POST /v1/messages?beta=true 200 - 12258ms
111
+ [2026-11-11T23:37:20.080Z] POST /v1/messages?beta=true 200 - 6772ms
112
+ [2026-11-11T23:37:27.479Z] POST /v1/messages?beta=true 200 - 10128ms
113
+ [2026-11-11T23:37:38.240Z] POST /v1/messages?beta=true 200 - 8789ms
114
+ [2026-11-11T23:37:47.050Z] POST /v1/messages?beta=true 200 - 5345ms
115
+ [2026-11-11T23:37:52.416Z] POST /v1/messages?beta=true 200 - 5979ms
116
+ [2026-11-11T23:37:58.428Z] POST /v1/messages?beta=true 200 - 7267ms
117
+ [2026-11-11T23:38:06.523Z] POST /v1/messages?beta=true 200 - 2831ms
118
+ [2026-11-11T23:38:09.406Z] POST /v1/messages?beta=true 200 - 4997ms
119
+ [2026-11-11T23:38:14.426Z] POST /v1/messages?beta=true 200 - 4417ms
120
+ [2026-11-11T23:38:18.868Z] POST /v1/messages?beta=true 200 - 4711ms
121
+ [2026-11-11T23:38:24.330Z] POST /v1/messages?beta=true 200 - 3411ms
122
+ [2026-11-11T23:38:29.068Z] POST /v1/messages?beta=true 200 - 18605ms
123
+ [2026-11-11T23:38:47.691Z] POST /v1/messages?beta=true 200 - 2783ms
124
+ [2026-11-11T23:38:50.499Z] POST /v1/messages?beta=true 200 - 55415ms
125
+ [2026-11-11T23:39:46.075Z] POST /v1/messages?beta=true 200 - 28073ms
126
+ [2026-11-11T23:40:22.094Z] POST /v1/messages?beta=true 200 - 13573ms
127
+ [2026-11-11T23:40:56.732Z] POST /v1/messages?beta=true 200 - 14131ms
128
+ [2026-11-11T23:41:12.210Z] POST /v1/messages?beta=true 200 - 14521ms
129
+ [2026-11-11T23:41:26.760Z] POST /v1/messages?beta=true 200 - 4720ms
130
+ [2026-11-11T23:41:39.687Z] POST /v1/messages?beta=true 200 - 17204ms
131
+ [2026-11-11T23:42:18.351Z] POST /v1/messages?beta=true 200 - 4578ms
132
+ [2026-11-11T23:42:36.785Z] POST /v1/messages?beta=true 200 - 11742ms
133
+ [2026-11-11T23:42:48.543Z] POST /v1/messages?beta=true 200 - 2842ms
134
+ [2026-11-11T23:42:51.401Z] POST /v1/messages?beta=true 200 - 28147ms
135
+ [2026-11-11T23:43:19.667Z] POST /v1/messages?beta=true 200 - 16598ms
136
+ [2026-11-11T23:43:36.532Z] POST /v1/messages?beta=true 200 - 17407ms
137
+ [2026-11-11T23:43:54.588Z] POST /v1/messages?beta=true 200 - 5654ms
138
+ [2026-11-11T23:44:00.265Z] POST /v1/messages?beta=true 200 - 4944ms
139
+ [2026-11-11T23:44:05.229Z] POST /v1/messages?beta=true 200 - 4223ms
140
+ [2026-11-11T23:44:09.573Z] POST /v1/messages?beta=true 200 - 4441ms
141
+ [2026-11-11T23:44:14.035Z] POST /v1/messages?beta=true 200 - 66399ms
142
+ [2026-11-11T23:45:20.468Z] POST /v1/messages?beta=true 200 - 92662ms
143
+ [2026-11-11T23:46:53.138Z] POST /v1/messages/count_tokens?beta=true 200 - 90ms
144
+ [2026-11-11T23:46:53.138Z] POST /v1/messages/count_tokens?beta=true 200 - 91ms
145
+ [2026-11-11T23:46:53.264Z] POST /v1/messages?beta=true 200 - 4581ms
146
+ [2026-11-11T23:46:57.856Z] POST /v1/messages?beta=true 200 - 12134ms
147
+ [2026-11-11T23:47:10.015Z] POST /v1/messages?beta=true 200 - 2069ms
148
+ [2026-11-11T23:47:12.110Z] POST /v1/messages?beta=true 200 - 4091ms
149
+ [2026-11-11T23:47:16.213Z] POST /v1/messages?beta=true 200 - 5489ms
150
+ [2026-11-11T23:47:21.711Z] POST /v1/messages?beta=true 200 - 13538ms
151
+ [2026-11-11T23:47:35.260Z] POST /v1/messages?beta=true 200 - 11957ms
152
+ [2026-11-11T23:47:47.242Z] POST /v1/messages?beta=true 200 - 7679ms
153
+ [2026-11-11T23:47:54.932Z] POST /v1/messages?beta=true 200 - 11647ms
154
+ [2026-11-11T23:48:06.604Z] POST /v1/messages?beta=true 200 - 7985ms
155
+ [2026-11-11T23:48:14.604Z] POST /v1/messages?beta=true 200 - 7738ms
156
+ [2026-11-11T23:48:22.358Z] POST /v1/messages?beta=true 200 - 10195ms
157
+ [2026-11-11T23:48:32.586Z] POST /v1/messages?beta=true 200 - 5063ms
158
+ [2026-11-11T23:48:37.672Z] POST /v1/messages?beta=true 200 - 3433ms
159
+ [2026-11-11T23:48:41.127Z] POST /v1/messages?beta=true 200 - 2461ms
160
+ [2026-11-11T23:48:43.604Z] POST /v1/messages?beta=true 200 - 22522ms
161
+ [2026-11-11T23:49:06.146Z] POST /v1/messages?beta=true 200 - 3405ms
162
+ [2026-11-11T23:49:09.569Z] POST /v1/messages?beta=true 200 - 3205ms
163
+ [2026-11-11T23:49:12.796Z] POST /v1/messages?beta=true 200 - 9357ms
164
+ [2026-11-11T23:49:22.685Z] POST /v1/messages?beta=true 200 - 22600ms
165
+ [2026-11-11T23:49:45.310Z] POST /v1/messages?beta=true 200 - 5289ms
166
+ [2026-11-11T23:49:50.611Z] POST /v1/messages?beta=true 200 - 6165ms
167
+ [2026-11-11T23:49:57.495Z] POST /v1/messages?beta=true 200 - 9251ms
168
+ [2026-11-11T23:50:06.832Z] POST /v1/messages?beta=true 200 - 4630ms
169
+ [2026-11-11T23:50:11.484Z] POST /v1/messages?beta=true 200 - 2356ms
170
+ [2026-11-11T23:50:13.859Z] POST /v1/messages?beta=true 200 - 12487ms
171
+ [2026-11-11T23:50:26.362Z] POST /v1/messages?beta=true 200 - 11562ms
172
+ [2026-11-11T23:50:39.900Z] POST /v1/messages?beta=true 200 - 7752ms
173
+ [2026-11-11T23:50:47.673Z] POST /v1/messages?beta=true 200 - 8365ms
174
+ [2026-11-11T23:50:56.052Z] POST /v1/messages?beta=true 200 - 7084ms
175
+ [2026-11-11 23:51:03.366][22][warning][main] [source/server/server.cc:981] caught ENVOY_SIGTERM
v2-models-effort/runs/20261111-214430-flat-disk/git-diff.patch ADDED
The diff for this file is too large to render. See raw diff
 
v2-models-effort/runs/20261111-214430-flat-disk/git-sha.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ 8422439f49db061ed5b56e9b883ef244807898f8
v2-models-effort/runs/20261111-214430-flat-disk/manifest.json ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "timestamp": "2026-11-11T22:45:01Z",
3
+ "completed_at": "2026-11-11T23:51:03Z",
4
+ "exit_code": 0,
5
+ "oom_killed": false,
6
+ "condition": {
7
+ "name": "source-python_unit-tests_source-integration-tests_effort-xhigh_model-claude-fable-5-2",
8
+ "source_language": "python",
9
+ "target_language": "javascript",
10
+ "include_unit_tests": true,
11
+ "include_source_integration_tests": true,
12
+ "include_target_integration_tests": false,
13
+ "effort": "xhigh",
14
+ "model": "claude-fable-5-2"
15
+ },
16
+ "derivation": {
17
+ "gbnf_commit": "13f1aca495d11e160fffd68c4ba299a2415909d8"
18
+ },
19
+ "reference_implementation": {
20
+ "included": [
21
+ "python/.gitignore",
22
+ "python/MANIFEST.in",
23
+ "python/Makefile",
24
+ "python/README.md",
25
+ "python/gbnf/GBNF.py",
26
+ "python/gbnf/__init__.py",
27
+ "python/gbnf/grammar_graph/__init__.py",
28
+ "python/gbnf/grammar_graph/colorize.py",
29
+ "python/gbnf/grammar_graph/colorize_test.py",
30
+ "python/gbnf/grammar_graph/get_input_as_code_points.py",
31
+ "python/gbnf/grammar_graph/get_input_as_code_points_test.py",
32
+ "python/gbnf/grammar_graph/get_parent_stack_id.py",
33
+ "python/gbnf/grammar_graph/get_parent_stack_id_test.py",
34
+ "python/gbnf/grammar_graph/get_serialized_rule_key.py",
35
+ "python/gbnf/grammar_graph/get_serialized_rule_key_test.py",
36
+ "python/gbnf/grammar_graph/grammar_graph_types.py",
37
+ "python/gbnf/grammar_graph/graph.py",
38
+ "python/gbnf/grammar_graph/graph_node.py",
39
+ "python/gbnf/grammar_graph/graph_node_test.py",
40
+ "python/gbnf/grammar_graph/graph_pointer.py",
41
+ "python/gbnf/grammar_graph/graph_pointer_test.py",
42
+ "python/gbnf/grammar_graph/graph_test.py",
43
+ "python/gbnf/grammar_graph/parse_state.py",
44
+ "python/gbnf/grammar_graph/parse_state_test.py",
45
+ "python/gbnf/grammar_graph/pointers.py",
46
+ "python/gbnf/grammar_graph/print.py",
47
+ "python/gbnf/grammar_graph/print_test.py",
48
+ "python/gbnf/grammar_graph/rule_ref.py",
49
+ "python/gbnf/grammar_graph/rule_ref_test.py",
50
+ "python/gbnf/grammar_graph/type_guards.py",
51
+ "python/gbnf/grammar_graph/type_guards_test.py",
52
+ "python/gbnf/grammar_parser/__init__.py",
53
+ "python/gbnf/grammar_parser/build_rule_stack.py",
54
+ "python/gbnf/grammar_parser/build_rule_stack_test.py",
55
+ "python/gbnf/rules_builder/__init__.py",
56
+ "python/gbnf/rules_builder/is_word_char.py",
57
+ "python/gbnf/rules_builder/is_word_char_test.py",
58
+ "python/gbnf/rules_builder/parse_char.py",
59
+ "python/gbnf/rules_builder/parse_char_test.py",
60
+ "python/gbnf/rules_builder/parse_name.py",
61
+ "python/gbnf/rules_builder/parse_name_test.py",
62
+ "python/gbnf/rules_builder/parse_space.py",
63
+ "python/gbnf/rules_builder/parse_space_test.py",
64
+ "python/gbnf/rules_builder/rules_builder.py",
65
+ "python/gbnf/rules_builder/rules_builder_test.py",
66
+ "python/gbnf/rules_builder/rules_builder_types.py",
67
+ "python/gbnf/rules_builder/symbol_ids.py",
68
+ "python/gbnf/utils/__init__.py",
69
+ "python/gbnf/utils/errors/__init__.py",
70
+ "python/gbnf/utils/errors/build_error_position.py",
71
+ "python/gbnf/utils/errors/build_error_position_test.py",
72
+ "python/gbnf/utils/errors/errors_types.py",
73
+ "python/gbnf/utils/errors/get_input_as_string.py",
74
+ "python/gbnf/utils/errors/get_input_as_string_test.py",
75
+ "python/gbnf/utils/errors/grammar_parse_error.py",
76
+ "python/gbnf/utils/errors/grammar_parse_error_test.py",
77
+ "python/gbnf/utils/errors/input_parse_error.py",
78
+ "python/gbnf/utils/errors/input_parse_error_test.py",
79
+ "python/gbnf/utils/is_point_in_range.py",
80
+ "python/gbnf/utils/is_point_in_range_test.py",
81
+ "python/gbnf/utils/validate_non_empty.py",
82
+ "python/pyproject.toml",
83
+ "python/requirements.txt",
84
+ "python/tests/generated/iteration/iteration_test.py",
85
+ "python/tests/generated/iteration/iteration_with_additional_strings_test.py",
86
+ "python/tests/generated/iteration/iteration_with_an_initial_string_test.py",
87
+ "python/tests/generated/validation/validate_grammar_test.py",
88
+ "python/tests/generated/validation/validate_input_test.py",
89
+ "python/uv.lock"
90
+ ]
91
+ },
92
+ "sandbox": {
93
+ "image_id": "sha256:c212d29a586dd2c026ba156debe2614612d99d26d776fc434d786ea3f9a7a030"
94
+ },
95
+ "harness": {
96
+ "commit": "8422439f49db061ed5b56e9b883ef244807898f8",
97
+ "dirty": true
98
+ }
99
+ }
v2-models-effort/runs/20261111-214430-flat-disk/memory.jsonl ADDED
@@ -0,0 +1,791 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"time": 1794437100.8748395, "rss": 31363072, "processes": 3}
2
+ {"time": 1794437105.8876734, "rss": 119795712, "processes": 5}
3
+ {"time": 1794437110.9021115, "rss": 119984128, "processes": 5}
4
+ {"time": 1794437115.9160264, "rss": 380813312, "processes": 6}
5
+ {"time": 1794437120.9300826, "rss": 404316160, "processes": 6}
6
+ {"time": 1794437125.9459782, "rss": 401780736, "processes": 6}
7
+ {"time": 1794437130.9602277, "rss": 397434880, "processes": 6}
8
+ {"time": 1794437135.975329, "rss": 394371072, "processes": 6}
9
+ {"time": 1794437140.990039, "rss": 391798784, "processes": 6}
10
+ {"time": 1794437146.0038984, "rss": 396476416, "processes": 6}
11
+ {"time": 1794437151.0184553, "rss": 394498048, "processes": 6}
12
+ {"time": 1794437156.0325434, "rss": 394686464, "processes": 6}
13
+ {"time": 1794437161.0481203, "rss": 393469952, "processes": 6}
14
+ {"time": 1794437166.063398, "rss": 390397952, "processes": 6}
15
+ {"time": 1794437171.0779538, "rss": 388685824, "processes": 6}
16
+ {"time": 1794437176.092404, "rss": 388866048, "processes": 6}
17
+ {"time": 1794437181.1062858, "rss": 393748480, "processes": 6}
18
+ {"time": 1794437186.1205425, "rss": 393052160, "processes": 6}
19
+ {"time": 1794437191.1349778, "rss": 394747904, "processes": 6}
20
+ {"time": 1794437196.1493216, "rss": 396075008, "processes": 6}
21
+ {"time": 1794437201.1639564, "rss": 395563008, "processes": 6}
22
+ {"time": 1794437206.1783679, "rss": 393875456, "processes": 6}
23
+ {"time": 1794437211.193207, "rss": 394256384, "processes": 6}
24
+ {"time": 1794437216.2080395, "rss": 393404416, "processes": 6}
25
+ {"time": 1794437221.2213662, "rss": 393596928, "processes": 6}
26
+ {"time": 1794437226.2362218, "rss": 393601024, "processes": 6}
27
+ {"time": 1794437231.250494, "rss": 393015296, "processes": 6}
28
+ {"time": 1794437236.2649436, "rss": 393486336, "processes": 6}
29
+ {"time": 1794437241.279322, "rss": 392658944, "processes": 6}
30
+ {"time": 1794437246.2935863, "rss": 393019392, "processes": 6}
31
+ {"time": 1794437251.3077147, "rss": 392421376, "processes": 6}
32
+ {"time": 1794437256.3225198, "rss": 391462912, "processes": 6}
33
+ {"time": 1794437261.3370311, "rss": 391090176, "processes": 6}
34
+ {"time": 1794437266.3522537, "rss": 393871360, "processes": 6}
35
+ {"time": 1794437271.3663135, "rss": 393785344, "processes": 6}
36
+ {"time": 1794437276.3812048, "rss": 391651328, "processes": 6}
37
+ {"time": 1794437281.395716, "rss": 390922240, "processes": 6}
38
+ {"time": 1794437286.409926, "rss": 391049216, "processes": 6}
39
+ {"time": 1794437291.4236703, "rss": 389156864, "processes": 6}
40
+ {"time": 1794437296.439666, "rss": 389124096, "processes": 6}
41
+ {"time": 1794437301.4534361, "rss": 389054464, "processes": 6}
42
+ {"time": 1794437306.4679255, "rss": 389554176, "processes": 6}
43
+ {"time": 1794437311.4818223, "rss": 389021696, "processes": 6}
44
+ {"time": 1794437316.4962473, "rss": 389566464, "processes": 6}
45
+ {"time": 1794437321.5116322, "rss": 389713920, "processes": 6}
46
+ {"time": 1794437326.5198925, "rss": 388653056, "processes": 6}
47
+ {"time": 1794437331.5322964, "rss": 388911104, "processes": 6}
48
+ {"time": 1794437336.5459383, "rss": 388874240, "processes": 6}
49
+ {"time": 1794437341.5576265, "rss": 388837376, "processes": 6}
50
+ {"time": 1794437346.5706918, "rss": 388546560, "processes": 6}
51
+ {"time": 1794437351.5851066, "rss": 388681728, "processes": 6}
52
+ {"time": 1794437356.597324, "rss": 388485120, "processes": 6}
53
+ {"time": 1794437361.611462, "rss": 388542464, "processes": 6}
54
+ {"time": 1794437366.6258216, "rss": 388530176, "processes": 6}
55
+ {"time": 1794437371.6396685, "rss": 388579328, "processes": 6}
56
+ {"time": 1794437376.6538627, "rss": 388427776, "processes": 6}
57
+ {"time": 1794437381.6685133, "rss": 387923968, "processes": 6}
58
+ {"time": 1794437386.681013, "rss": 387969024, "processes": 6}
59
+ {"time": 1794437391.695791, "rss": 388485120, "processes": 6}
60
+ {"time": 1794437396.7100644, "rss": 388235264, "processes": 6}
61
+ {"time": 1794437401.72276, "rss": 388177920, "processes": 6}
62
+ {"time": 1794437406.7377033, "rss": 388718592, "processes": 6}
63
+ {"time": 1794437411.7525382, "rss": 388956160, "processes": 6}
64
+ {"time": 1794437416.7669387, "rss": 388722688, "processes": 6}
65
+ {"time": 1794437421.7808893, "rss": 388714496, "processes": 6}
66
+ {"time": 1794437426.795692, "rss": 388767744, "processes": 6}
67
+ {"time": 1794437431.811009, "rss": 389308416, "processes": 6}
68
+ {"time": 1794437436.825655, "rss": 387932160, "processes": 6}
69
+ {"time": 1794437441.8402586, "rss": 388157440, "processes": 6}
70
+ {"time": 1794437446.8537364, "rss": 386355200, "processes": 6}
71
+ {"time": 1794437451.8675969, "rss": 387141632, "processes": 6}
72
+ {"time": 1794437456.881371, "rss": 386646016, "processes": 6}
73
+ {"time": 1794437461.8955903, "rss": 387321856, "processes": 6}
74
+ {"time": 1794437466.910204, "rss": 387170304, "processes": 6}
75
+ {"time": 1794437471.9251287, "rss": 387325952, "processes": 6}
76
+ {"time": 1794437476.9395633, "rss": 386609152, "processes": 6}
77
+ {"time": 1794437481.9536555, "rss": 386629632, "processes": 6}
78
+ {"time": 1794437486.9683, "rss": 387440640, "processes": 6}
79
+ {"time": 1794437491.9829707, "rss": 397295616, "processes": 6}
80
+ {"time": 1794437496.9971068, "rss": 398614528, "processes": 6}
81
+ {"time": 1794437502.0108542, "rss": 398725120, "processes": 6}
82
+ {"time": 1794437507.0244608, "rss": 397074432, "processes": 6}
83
+ {"time": 1794437512.039362, "rss": 403689472, "processes": 6}
84
+ {"time": 1794437517.0533655, "rss": 402972672, "processes": 6}
85
+ {"time": 1794437522.0685663, "rss": 403746816, "processes": 6}
86
+ {"time": 1794437527.0828424, "rss": 403255296, "processes": 6}
87
+ {"time": 1794437532.0972762, "rss": 399306752, "processes": 6}
88
+ {"time": 1794437537.1126935, "rss": 398438400, "processes": 6}
89
+ {"time": 1794437542.1270807, "rss": 397795328, "processes": 6}
90
+ {"time": 1794437547.1416416, "rss": 399753216, "processes": 6}
91
+ {"time": 1794437552.1559985, "rss": 400322560, "processes": 6}
92
+ {"time": 1794437557.1703951, "rss": 400068608, "processes": 6}
93
+ {"time": 1794437562.1850653, "rss": 393846784, "processes": 6}
94
+ {"time": 1794437567.2004836, "rss": 393502720, "processes": 6}
95
+ {"time": 1794437572.2143412, "rss": 392921088, "processes": 6}
96
+ {"time": 1794437577.228474, "rss": 393396224, "processes": 6}
97
+ {"time": 1794437582.2423584, "rss": 393695232, "processes": 6}
98
+ {"time": 1794437587.2561924, "rss": 394178560, "processes": 6}
99
+ {"time": 1794437592.2707303, "rss": 394432512, "processes": 6}
100
+ {"time": 1794437597.284838, "rss": 393519104, "processes": 6}
101
+ {"time": 1794437602.2994633, "rss": 394002432, "processes": 6}
102
+ {"time": 1794437607.3114948, "rss": 393920512, "processes": 6}
103
+ {"time": 1794437612.3255289, "rss": 392437760, "processes": 6}
104
+ {"time": 1794437617.3404887, "rss": 392445952, "processes": 6}
105
+ {"time": 1794437622.3546214, "rss": 392663040, "processes": 6}
106
+ {"time": 1794437627.3686817, "rss": 392581120, "processes": 6}
107
+ {"time": 1794437632.3832743, "rss": 391847936, "processes": 6}
108
+ {"time": 1794437637.3973155, "rss": 393072640, "processes": 6}
109
+ {"time": 1794437642.4123945, "rss": 392937472, "processes": 6}
110
+ {"time": 1794437647.4263573, "rss": 392982528, "processes": 6}
111
+ {"time": 1794437652.4401002, "rss": 393461760, "processes": 6}
112
+ {"time": 1794437657.454528, "rss": 393486336, "processes": 6}
113
+ {"time": 1794437662.4685564, "rss": 393211904, "processes": 6}
114
+ {"time": 1794437667.4833355, "rss": 391700480, "processes": 6}
115
+ {"time": 1794437672.4976594, "rss": 392232960, "processes": 6}
116
+ {"time": 1794437677.5119314, "rss": 392179712, "processes": 6}
117
+ {"time": 1794437682.5260098, "rss": 392364032, "processes": 6}
118
+ {"time": 1794437687.5372827, "rss": 392548352, "processes": 6}
119
+ {"time": 1794437692.5503914, "rss": 392343552, "processes": 6}
120
+ {"time": 1794437697.5637472, "rss": 392269824, "processes": 6}
121
+ {"time": 1794437702.577697, "rss": 392695808, "processes": 6}
122
+ {"time": 1794437707.5924225, "rss": 392404992, "processes": 6}
123
+ {"time": 1794437712.6077125, "rss": 392433664, "processes": 6}
124
+ {"time": 1794437717.6222236, "rss": 392114176, "processes": 6}
125
+ {"time": 1794437722.6369693, "rss": 392695808, "processes": 6}
126
+ {"time": 1794437727.6501746, "rss": 391585792, "processes": 6}
127
+ {"time": 1794437732.664331, "rss": 382390272, "processes": 6}
128
+ {"time": 1794437737.6791751, "rss": 382169088, "processes": 6}
129
+ {"time": 1794437742.6936586, "rss": 381935616, "processes": 6}
130
+ {"time": 1794437747.7086315, "rss": 382353408, "processes": 6}
131
+ {"time": 1794437752.7232177, "rss": 382058496, "processes": 6}
132
+ {"time": 1794437757.737904, "rss": 381956096, "processes": 6}
133
+ {"time": 1794437762.7521067, "rss": 382169088, "processes": 6}
134
+ {"time": 1794437767.766272, "rss": 381984768, "processes": 6}
135
+ {"time": 1794437772.7806325, "rss": 382337024, "processes": 6}
136
+ {"time": 1794437777.794562, "rss": 382066688, "processes": 6}
137
+ {"time": 1794437782.8087156, "rss": 382599168, "processes": 6}
138
+ {"time": 1794437787.8231957, "rss": 382660608, "processes": 6}
139
+ {"time": 1794437792.8375907, "rss": 382537728, "processes": 6}
140
+ {"time": 1794437797.8517623, "rss": 382529536, "processes": 6}
141
+ {"time": 1794437802.8664284, "rss": 382377984, "processes": 6}
142
+ {"time": 1794437807.8811107, "rss": 381829120, "processes": 6}
143
+ {"time": 1794437812.895017, "rss": 380837888, "processes": 6}
144
+ {"time": 1794437817.909068, "rss": 380817408, "processes": 6}
145
+ {"time": 1794437822.922646, "rss": 380465152, "processes": 6}
146
+ {"time": 1794437827.9364588, "rss": 380739584, "processes": 6}
147
+ {"time": 1794437832.9505644, "rss": 425086976, "processes": 6}
148
+ {"time": 1794437837.9654553, "rss": 427089920, "processes": 6}
149
+ {"time": 1794437842.9798982, "rss": 428544000, "processes": 6}
150
+ {"time": 1794437847.9945521, "rss": 426889216, "processes": 6}
151
+ {"time": 1794437853.009032, "rss": 424390656, "processes": 6}
152
+ {"time": 1794437858.0241776, "rss": 423591936, "processes": 6}
153
+ {"time": 1794437863.0379817, "rss": 422989824, "processes": 6}
154
+ {"time": 1794437868.0525053, "rss": 418729984, "processes": 6}
155
+ {"time": 1794437873.0671406, "rss": 418193408, "processes": 6}
156
+ {"time": 1794437878.0816932, "rss": 418443264, "processes": 6}
157
+ {"time": 1794437883.095708, "rss": 418680832, "processes": 6}
158
+ {"time": 1794437888.1107156, "rss": 418373632, "processes": 6}
159
+ {"time": 1794437893.1248655, "rss": 417206272, "processes": 6}
160
+ {"time": 1794437898.1403131, "rss": 417972224, "processes": 6}
161
+ {"time": 1794437903.154763, "rss": 418353152, "processes": 6}
162
+ {"time": 1794437908.1690466, "rss": 417988608, "processes": 6}
163
+ {"time": 1794437913.1832926, "rss": 418009088, "processes": 6}
164
+ {"time": 1794437918.1987715, "rss": 416321536, "processes": 6}
165
+ {"time": 1794437923.2137485, "rss": 416174080, "processes": 6}
166
+ {"time": 1794437928.22789, "rss": 415625216, "processes": 6}
167
+ {"time": 1794437933.2425065, "rss": 416124928, "processes": 6}
168
+ {"time": 1794437938.256745, "rss": 419131392, "processes": 6}
169
+ {"time": 1794437943.2713704, "rss": 419344384, "processes": 6}
170
+ {"time": 1794437948.2854335, "rss": 419418112, "processes": 6}
171
+ {"time": 1794437953.3002083, "rss": 419315712, "processes": 6}
172
+ {"time": 1794437958.3149729, "rss": 417206272, "processes": 6}
173
+ {"time": 1794437963.3292239, "rss": 417468416, "processes": 6}
174
+ {"time": 1794437968.3435729, "rss": 410783744, "processes": 6}
175
+ {"time": 1794437973.3589783, "rss": 409907200, "processes": 6}
176
+ {"time": 1794437978.373701, "rss": 409407488, "processes": 6}
177
+ {"time": 1794437983.3885982, "rss": 408477696, "processes": 6}
178
+ {"time": 1794437988.4033303, "rss": 408940544, "processes": 6}
179
+ {"time": 1794437993.4180326, "rss": 408702976, "processes": 6}
180
+ {"time": 1794437998.4323, "rss": 408178688, "processes": 6}
181
+ {"time": 1794438003.446756, "rss": 407531520, "processes": 6}
182
+ {"time": 1794438008.4610868, "rss": 407752704, "processes": 6}
183
+ {"time": 1794438013.476344, "rss": 407748608, "processes": 6}
184
+ {"time": 1794438018.4911962, "rss": 407941120, "processes": 6}
185
+ {"time": 1794438023.505498, "rss": 407756800, "processes": 6}
186
+ {"time": 1794438028.5207055, "rss": 407732224, "processes": 6}
187
+ {"time": 1794438033.5319064, "rss": 407175168, "processes": 6}
188
+ {"time": 1794438038.5430584, "rss": 407408640, "processes": 6}
189
+ {"time": 1794438043.5550432, "rss": 407597056, "processes": 6}
190
+ {"time": 1794438048.5672112, "rss": 408031232, "processes": 6}
191
+ {"time": 1794438053.582356, "rss": 408076288, "processes": 6}
192
+ {"time": 1794438058.5976095, "rss": 407478272, "processes": 6}
193
+ {"time": 1794438063.6123538, "rss": 407703552, "processes": 6}
194
+ {"time": 1794438068.6265678, "rss": 406859776, "processes": 6}
195
+ {"time": 1794438073.6409357, "rss": 407515136, "processes": 6}
196
+ {"time": 1794438078.6553419, "rss": 407506944, "processes": 6}
197
+ {"time": 1794438083.667618, "rss": 407494656, "processes": 6}
198
+ {"time": 1794438088.6828597, "rss": 407474176, "processes": 6}
199
+ {"time": 1794438093.6975372, "rss": 407728128, "processes": 6}
200
+ {"time": 1794438098.711826, "rss": 407646208, "processes": 6}
201
+ {"time": 1794438103.725521, "rss": 409980928, "processes": 6}
202
+ {"time": 1794438108.7401705, "rss": 423030784, "processes": 6}
203
+ {"time": 1794438113.7544255, "rss": 422100992, "processes": 6}
204
+ {"time": 1794438118.7690203, "rss": 427773952, "processes": 6}
205
+ {"time": 1794438123.7832441, "rss": 426700800, "processes": 6}
206
+ {"time": 1794438128.7972531, "rss": 426381312, "processes": 6}
207
+ {"time": 1794438133.8115888, "rss": 422006784, "processes": 6}
208
+ {"time": 1794438138.8266962, "rss": 421163008, "processes": 6}
209
+ {"time": 1794438143.841293, "rss": 421421056, "processes": 6}
210
+ {"time": 1794438148.8552017, "rss": 421105664, "processes": 6}
211
+ {"time": 1794438153.8690593, "rss": 436133888, "processes": 6}
212
+ {"time": 1794438158.8833969, "rss": 432934912, "processes": 6}
213
+ {"time": 1794438163.8977032, "rss": 433008640, "processes": 6}
214
+ {"time": 1794438168.9131584, "rss": 433233920, "processes": 6}
215
+ {"time": 1794438173.9273887, "rss": 433696768, "processes": 6}
216
+ {"time": 1794438178.9413474, "rss": 428859392, "processes": 6}
217
+ {"time": 1794438183.9559677, "rss": 425738240, "processes": 6}
218
+ {"time": 1794438188.9702315, "rss": 427425792, "processes": 6}
219
+ {"time": 1794438193.983899, "rss": 426934272, "processes": 6}
220
+ {"time": 1794438198.998257, "rss": 426807296, "processes": 6}
221
+ {"time": 1794438204.0124946, "rss": 422309888, "processes": 6}
222
+ {"time": 1794438209.0269263, "rss": 422055936, "processes": 6}
223
+ {"time": 1794438214.0414212, "rss": 424570880, "processes": 6}
224
+ {"time": 1794438219.0557623, "rss": 423088128, "processes": 6}
225
+ {"time": 1794438224.07057, "rss": 425263104, "processes": 6}
226
+ {"time": 1794438229.08464, "rss": 425508864, "processes": 6}
227
+ {"time": 1794438234.0991702, "rss": 426082304, "processes": 6}
228
+ {"time": 1794438239.1136806, "rss": 423198720, "processes": 6}
229
+ {"time": 1794438244.1284668, "rss": 423432192, "processes": 6}
230
+ {"time": 1794438249.142897, "rss": 423505920, "processes": 6}
231
+ {"time": 1794438254.1582918, "rss": 424136704, "processes": 6}
232
+ {"time": 1794438259.1725054, "rss": 424214528, "processes": 6}
233
+ {"time": 1794438264.1865935, "rss": 424615936, "processes": 6}
234
+ {"time": 1794438269.2006266, "rss": 424136704, "processes": 6}
235
+ {"time": 1794438274.2154348, "rss": 424267776, "processes": 6}
236
+ {"time": 1794438279.2294164, "rss": 423120896, "processes": 6}
237
+ {"time": 1794438284.2435968, "rss": 422551552, "processes": 6}
238
+ {"time": 1794438289.2578294, "rss": 422305792, "processes": 6}
239
+ {"time": 1794438294.2721224, "rss": 421986304, "processes": 6}
240
+ {"time": 1794438299.2864554, "rss": 415936512, "processes": 6}
241
+ {"time": 1794438304.3010516, "rss": 414760960, "processes": 6}
242
+ {"time": 1794438309.3166094, "rss": 413347840, "processes": 6}
243
+ {"time": 1794438314.330769, "rss": 412975104, "processes": 6}
244
+ {"time": 1794438319.3446915, "rss": 412655616, "processes": 6}
245
+ {"time": 1794438324.358602, "rss": 412655616, "processes": 6}
246
+ {"time": 1794438329.3725834, "rss": 412848128, "processes": 6}
247
+ {"time": 1794438334.3878481, "rss": 413106176, "processes": 6}
248
+ {"time": 1794438339.401839, "rss": 412790784, "processes": 6}
249
+ {"time": 1794438344.4161768, "rss": 412651520, "processes": 6}
250
+ {"time": 1794438349.4301553, "rss": 412651520, "processes": 6}
251
+ {"time": 1794438354.444859, "rss": 412651520, "processes": 6}
252
+ {"time": 1794438359.4587314, "rss": 413110272, "processes": 6}
253
+ {"time": 1794438364.4728086, "rss": 412852224, "processes": 6}
254
+ {"time": 1794438369.4868774, "rss": 413052928, "processes": 6}
255
+ {"time": 1794438374.5013447, "rss": 412971008, "processes": 6}
256
+ {"time": 1794438379.5156498, "rss": 412680192, "processes": 6}
257
+ {"time": 1794438384.5261343, "rss": 412680192, "processes": 6}
258
+ {"time": 1794438389.5376282, "rss": 412884992, "processes": 6}
259
+ {"time": 1794438394.5508873, "rss": 412884992, "processes": 6}
260
+ {"time": 1794438399.5628633, "rss": 412798976, "processes": 6}
261
+ {"time": 1794438404.5764441, "rss": 412684288, "processes": 6}
262
+ {"time": 1794438409.5897927, "rss": 413208576, "processes": 6}
263
+ {"time": 1794438414.6033134, "rss": 412946432, "processes": 6}
264
+ {"time": 1794438419.6166046, "rss": 413405184, "processes": 6}
265
+ {"time": 1794438424.631301, "rss": 413175808, "processes": 6}
266
+ {"time": 1794438429.6456058, "rss": 412856320, "processes": 6}
267
+ {"time": 1794438434.6599295, "rss": 412995584, "processes": 6}
268
+ {"time": 1794438439.673645, "rss": 412684288, "processes": 6}
269
+ {"time": 1794438444.6882248, "rss": 412688384, "processes": 6}
270
+ {"time": 1794438449.7037563, "rss": 412860416, "processes": 6}
271
+ {"time": 1794438454.7179406, "rss": 413122560, "processes": 6}
272
+ {"time": 1794438459.7322726, "rss": 412798976, "processes": 6}
273
+ {"time": 1794438464.747187, "rss": 412733440, "processes": 6}
274
+ {"time": 1794438469.7617092, "rss": 412676096, "processes": 6}
275
+ {"time": 1794438474.775883, "rss": 412676096, "processes": 6}
276
+ {"time": 1794438479.7901375, "rss": 412934144, "processes": 6}
277
+ {"time": 1794438484.8046205, "rss": 412876800, "processes": 6}
278
+ {"time": 1794438489.8186922, "rss": 412848128, "processes": 6}
279
+ {"time": 1794438494.832934, "rss": 412733440, "processes": 6}
280
+ {"time": 1794438499.8473134, "rss": 412733440, "processes": 6}
281
+ {"time": 1794438504.8615592, "rss": 412991488, "processes": 6}
282
+ {"time": 1794438509.8760307, "rss": 413057024, "processes": 6}
283
+ {"time": 1794438514.89061, "rss": 413057024, "processes": 6}
284
+ {"time": 1794438519.9092367, "rss": 412971008, "processes": 6}
285
+ {"time": 1794438524.9234266, "rss": 412909568, "processes": 6}
286
+ {"time": 1794438529.9381416, "rss": 412737536, "processes": 6}
287
+ {"time": 1794438534.9525135, "rss": 413003776, "processes": 6}
288
+ {"time": 1794438539.96665, "rss": 413257728, "processes": 6}
289
+ {"time": 1794438544.980357, "rss": 412942336, "processes": 6}
290
+ {"time": 1794438549.99444, "rss": 412856320, "processes": 6}
291
+ {"time": 1794438555.0101912, "rss": 412798976, "processes": 6}
292
+ {"time": 1794438560.0242891, "rss": 412770304, "processes": 6}
293
+ {"time": 1794438565.038697, "rss": 413290496, "processes": 6}
294
+ {"time": 1794438570.0530307, "rss": 413290496, "processes": 6}
295
+ {"time": 1794438575.0681362, "rss": 413368320, "processes": 6}
296
+ {"time": 1794438580.0819387, "rss": 417521664, "processes": 6}
297
+ {"time": 1794438585.096496, "rss": 417349632, "processes": 6}
298
+ {"time": 1794438590.110957, "rss": 416083968, "processes": 6}
299
+ {"time": 1794438595.1213565, "rss": 416026624, "processes": 6}
300
+ {"time": 1794438600.135463, "rss": 415580160, "processes": 6}
301
+ {"time": 1794438605.1494448, "rss": 415080448, "processes": 6}
302
+ {"time": 1794438610.1634297, "rss": 413884416, "processes": 6}
303
+ {"time": 1794438615.1776435, "rss": 414375936, "processes": 6}
304
+ {"time": 1794438620.1928184, "rss": 414347264, "processes": 6}
305
+ {"time": 1794438625.2071583, "rss": 414867456, "processes": 6}
306
+ {"time": 1794438630.2218378, "rss": 414568448, "processes": 6}
307
+ {"time": 1794438635.2361302, "rss": 414306304, "processes": 6}
308
+ {"time": 1794438640.250128, "rss": 414277632, "processes": 6}
309
+ {"time": 1794438645.2639666, "rss": 414216192, "processes": 6}
310
+ {"time": 1794438650.2783668, "rss": 413843456, "processes": 6}
311
+ {"time": 1794438655.2929113, "rss": 413843456, "processes": 6}
312
+ {"time": 1794438660.3084128, "rss": 414056448, "processes": 6}
313
+ {"time": 1794438665.3225477, "rss": 414003200, "processes": 6}
314
+ {"time": 1794438670.336518, "rss": 413917184, "processes": 6}
315
+ {"time": 1794438675.3504922, "rss": 414146560, "processes": 6}
316
+ {"time": 1794438680.364525, "rss": 428331008, "processes": 6}
317
+ {"time": 1794438685.3793137, "rss": 441520128, "processes": 6}
318
+ {"time": 1794438690.393873, "rss": 438693888, "processes": 6}
319
+ {"time": 1794438695.4055684, "rss": 437944320, "processes": 6}
320
+ {"time": 1794438700.4200525, "rss": 440356864, "processes": 6}
321
+ {"time": 1794438705.4338696, "rss": 439279616, "processes": 6}
322
+ {"time": 1794438710.4480317, "rss": 435511296, "processes": 6}
323
+ {"time": 1794438715.462831, "rss": 443002880, "processes": 6}
324
+ {"time": 1794438720.4782655, "rss": 432480256, "processes": 6}
325
+ {"time": 1794438725.4929066, "rss": 431628288, "processes": 6}
326
+ {"time": 1794438730.5077696, "rss": 435531776, "processes": 6}
327
+ {"time": 1794438735.522581, "rss": 436293632, "processes": 6}
328
+ {"time": 1794438740.5344915, "rss": 434728960, "processes": 6}
329
+ {"time": 1794438745.5463934, "rss": 436248576, "processes": 6}
330
+ {"time": 1794438750.5595536, "rss": 434962432, "processes": 6}
331
+ {"time": 1794438755.5722895, "rss": 433283072, "processes": 6}
332
+ {"time": 1794438760.5853612, "rss": 430370816, "processes": 6}
333
+ {"time": 1794438765.6006398, "rss": 430788608, "processes": 6}
334
+ {"time": 1794438770.6151605, "rss": 437796864, "processes": 6}
335
+ {"time": 1794438775.6302297, "rss": 435994624, "processes": 6}
336
+ {"time": 1794438780.6442695, "rss": 437981184, "processes": 6}
337
+ {"time": 1794438785.6582823, "rss": 436609024, "processes": 6}
338
+ {"time": 1794438790.6724205, "rss": 435556352, "processes": 6}
339
+ {"time": 1794438795.6867142, "rss": 434274304, "processes": 6}
340
+ {"time": 1794438800.7014585, "rss": 438153216, "processes": 6}
341
+ {"time": 1794438805.7155347, "rss": 437399552, "processes": 6}
342
+ {"time": 1794438810.7307386, "rss": 434528256, "processes": 6}
343
+ {"time": 1794438815.7454293, "rss": 434257920, "processes": 6}
344
+ {"time": 1794438820.7598283, "rss": 434053120, "processes": 6}
345
+ {"time": 1794438825.774582, "rss": 433926144, "processes": 6}
346
+ {"time": 1794438830.7884054, "rss": 433897472, "processes": 6}
347
+ {"time": 1794438835.8031204, "rss": 433868800, "processes": 6}
348
+ {"time": 1794438840.817997, "rss": 430891008, "processes": 6}
349
+ {"time": 1794438845.832507, "rss": 430899200, "processes": 6}
350
+ {"time": 1794438850.8467877, "rss": 430120960, "processes": 6}
351
+ {"time": 1794438855.8616066, "rss": 430362624, "processes": 6}
352
+ {"time": 1794438860.8759532, "rss": 430301184, "processes": 6}
353
+ {"time": 1794438865.8906054, "rss": 436834304, "processes": 6}
354
+ {"time": 1794438870.9052815, "rss": 434810880, "processes": 6}
355
+ {"time": 1794438875.920305, "rss": 432644096, "processes": 6}
356
+ {"time": 1794438880.9348392, "rss": 436731904, "processes": 6}
357
+ {"time": 1794438885.948974, "rss": 435257344, "processes": 6}
358
+ {"time": 1794438890.9632614, "rss": 436572160, "processes": 6}
359
+ {"time": 1794438895.9768944, "rss": 436748288, "processes": 6}
360
+ {"time": 1794438900.991063, "rss": 434094080, "processes": 6}
361
+ {"time": 1794438906.005014, "rss": 432812032, "processes": 6}
362
+ {"time": 1794438911.0198028, "rss": 432308224, "processes": 6}
363
+ {"time": 1794438916.0340626, "rss": 431878144, "processes": 6}
364
+ {"time": 1794438921.0478237, "rss": 431800320, "processes": 6}
365
+ {"time": 1794438926.0620813, "rss": 431804416, "processes": 6}
366
+ {"time": 1794438931.0765362, "rss": 431812608, "processes": 6}
367
+ {"time": 1794438936.0907304, "rss": 431808512, "processes": 6}
368
+ {"time": 1794438941.1054173, "rss": 431693824, "processes": 6}
369
+ {"time": 1794438946.120093, "rss": 431128576, "processes": 6}
370
+ {"time": 1794438951.1342592, "rss": 432029696, "processes": 6}
371
+ {"time": 1794438956.148392, "rss": 450519040, "processes": 6}
372
+ {"time": 1794438961.1639392, "rss": 447909888, "processes": 6}
373
+ {"time": 1794438966.1790674, "rss": 446918656, "processes": 6}
374
+ {"time": 1794438971.1933029, "rss": 446955520, "processes": 6}
375
+ {"time": 1794438976.2077665, "rss": 446005248, "processes": 6}
376
+ {"time": 1794438981.2216415, "rss": 444747776, "processes": 6}
377
+ {"time": 1794438986.2367053, "rss": 444583936, "processes": 6}
378
+ {"time": 1794438991.2511973, "rss": 444338176, "processes": 6}
379
+ {"time": 1794438996.2659407, "rss": 444325888, "processes": 6}
380
+ {"time": 1794439001.2805786, "rss": 444166144, "processes": 6}
381
+ {"time": 1794439006.2954636, "rss": 444723200, "processes": 6}
382
+ {"time": 1794439011.3095775, "rss": 443727872, "processes": 6}
383
+ {"time": 1794439016.3242571, "rss": 444235776, "processes": 6}
384
+ {"time": 1794439021.3387864, "rss": 444170240, "processes": 6}
385
+ {"time": 1794439026.3532267, "rss": 444182528, "processes": 6}
386
+ {"time": 1794439031.3675973, "rss": 443883520, "processes": 6}
387
+ {"time": 1794439036.3817298, "rss": 443838464, "processes": 6}
388
+ {"time": 1794439041.3961985, "rss": 442200064, "processes": 6}
389
+ {"time": 1794439046.4104748, "rss": 441933824, "processes": 6}
390
+ {"time": 1794439051.4248188, "rss": 442220544, "processes": 6}
391
+ {"time": 1794439056.439467, "rss": 441901056, "processes": 6}
392
+ {"time": 1794439061.4532416, "rss": 442376192, "processes": 6}
393
+ {"time": 1794439066.4689214, "rss": 441835520, "processes": 6}
394
+ {"time": 1794439071.4828737, "rss": 441978880, "processes": 6}
395
+ {"time": 1794439076.4972217, "rss": 442241024, "processes": 6}
396
+ {"time": 1794439081.511164, "rss": 442167296, "processes": 6}
397
+ {"time": 1794439086.5257084, "rss": 442437632, "processes": 6}
398
+ {"time": 1794439091.537549, "rss": 442863616, "processes": 6}
399
+ {"time": 1794439096.5502741, "rss": 442400768, "processes": 6}
400
+ {"time": 1794439101.563275, "rss": 442781696, "processes": 6}
401
+ {"time": 1794439106.5761163, "rss": 442466304, "processes": 6}
402
+ {"time": 1794439111.5894344, "rss": 442171392, "processes": 6}
403
+ {"time": 1794439116.6033113, "rss": 442146816, "processes": 6}
404
+ {"time": 1794439121.6173685, "rss": 442351616, "processes": 6}
405
+ {"time": 1794439126.6298032, "rss": 442277888, "processes": 6}
406
+ {"time": 1794439131.6445413, "rss": 441769984, "processes": 6}
407
+ {"time": 1794439136.658782, "rss": 442974208, "processes": 6}
408
+ {"time": 1794439141.672768, "rss": 447995904, "processes": 6}
409
+ {"time": 1794439146.6872628, "rss": 446328832, "processes": 6}
410
+ {"time": 1794439151.7016976, "rss": 444014592, "processes": 6}
411
+ {"time": 1794439156.7145674, "rss": 451624960, "processes": 6}
412
+ {"time": 1794439161.7289386, "rss": 451473408, "processes": 6}
413
+ {"time": 1794439166.7432446, "rss": 450682880, "processes": 6}
414
+ {"time": 1794439171.757508, "rss": 446791680, "processes": 6}
415
+ {"time": 1794439176.7716033, "rss": 445911040, "processes": 6}
416
+ {"time": 1794439181.7860794, "rss": 445210624, "processes": 6}
417
+ {"time": 1794439186.799899, "rss": 453742592, "processes": 6}
418
+ {"time": 1794439191.8147697, "rss": 451162112, "processes": 6}
419
+ {"time": 1794439196.8285465, "rss": 448118784, "processes": 6}
420
+ {"time": 1794439201.841095, "rss": 446652416, "processes": 6}
421
+ {"time": 1794439206.8550017, "rss": 446365696, "processes": 6}
422
+ {"time": 1794439211.8688853, "rss": 445755392, "processes": 6}
423
+ {"time": 1794439216.8828595, "rss": 458539008, "processes": 6}
424
+ {"time": 1794439221.897595, "rss": 458797056, "processes": 6}
425
+ {"time": 1794439226.9124706, "rss": 455315456, "processes": 6}
426
+ {"time": 1794439231.9273355, "rss": 450007040, "processes": 6}
427
+ {"time": 1794439236.94155, "rss": 449101824, "processes": 6}
428
+ {"time": 1794439241.9563782, "rss": 448598016, "processes": 6}
429
+ {"time": 1794439246.9706764, "rss": 448512000, "processes": 6}
430
+ {"time": 1794439251.9843192, "rss": 449007616, "processes": 6}
431
+ {"time": 1794439256.9984815, "rss": 459169792, "processes": 6}
432
+ {"time": 1794439262.013695, "rss": 452571136, "processes": 6}
433
+ {"time": 1794439267.029029, "rss": 451223552, "processes": 6}
434
+ {"time": 1794439272.0431385, "rss": 451026944, "processes": 6}
435
+ {"time": 1794439277.0575404, "rss": 451248128, "processes": 6}
436
+ {"time": 1794439282.0717862, "rss": 450441216, "processes": 6}
437
+ {"time": 1794439287.0859275, "rss": 450125824, "processes": 6}
438
+ {"time": 1794439292.0997598, "rss": 479670272, "processes": 6}
439
+ {"time": 1794439297.1141746, "rss": 474931200, "processes": 6}
440
+ {"time": 1794439302.1283295, "rss": 474087424, "processes": 6}
441
+ {"time": 1794439307.1424863, "rss": 469852160, "processes": 6}
442
+ {"time": 1794439312.1567578, "rss": 479465472, "processes": 6}
443
+ {"time": 1794439317.170971, "rss": 478560256, "processes": 6}
444
+ {"time": 1794439322.185018, "rss": 470159360, "processes": 6}
445
+ {"time": 1794439327.199442, "rss": 468803584, "processes": 6}
446
+ {"time": 1794439332.2137349, "rss": 466903040, "processes": 6}
447
+ {"time": 1794439337.227358, "rss": 476262400, "processes": 6}
448
+ {"time": 1794439342.2418373, "rss": 476147712, "processes": 6}
449
+ {"time": 1794439347.2565415, "rss": 479854592, "processes": 6}
450
+ {"time": 1794439352.2712405, "rss": 474873856, "processes": 6}
451
+ {"time": 1794439357.2855425, "rss": 473026560, "processes": 6}
452
+ {"time": 1794439362.3001876, "rss": 472363008, "processes": 6}
453
+ {"time": 1794439367.314591, "rss": 471384064, "processes": 6}
454
+ {"time": 1794439372.3301773, "rss": 471023616, "processes": 6}
455
+ {"time": 1794439377.3443322, "rss": 470523904, "processes": 6}
456
+ {"time": 1794439382.3582292, "rss": 470396928, "processes": 6}
457
+ {"time": 1794439387.3719974, "rss": 470618112, "processes": 6}
458
+ {"time": 1794439392.3860953, "rss": 470536192, "processes": 6}
459
+ {"time": 1794439397.4010675, "rss": 470503424, "processes": 6}
460
+ {"time": 1794439402.4150856, "rss": 477913088, "processes": 6}
461
+ {"time": 1794439407.4298005, "rss": 477593600, "processes": 6}
462
+ {"time": 1794439412.443805, "rss": 477458432, "processes": 6}
463
+ {"time": 1794439417.457608, "rss": 477638656, "processes": 6}
464
+ {"time": 1794439422.4714289, "rss": 474193920, "processes": 6}
465
+ {"time": 1794439427.485895, "rss": 474492928, "processes": 6}
466
+ {"time": 1794439432.5003173, "rss": 471875584, "processes": 6}
467
+ {"time": 1794439437.5149899, "rss": 472137728, "processes": 6}
468
+ {"time": 1794439442.5281436, "rss": 472969216, "processes": 6}
469
+ {"time": 1794439447.5412238, "rss": 473505792, "processes": 6}
470
+ {"time": 1794439452.5533142, "rss": 472948736, "processes": 6}
471
+ {"time": 1794439457.5666502, "rss": 472854528, "processes": 6}
472
+ {"time": 1794439462.579897, "rss": 473935872, "processes": 6}
473
+ {"time": 1794439467.5943563, "rss": 473800704, "processes": 6}
474
+ {"time": 1794439472.6087964, "rss": 469831680, "processes": 6}
475
+ {"time": 1794439477.622588, "rss": 469458944, "processes": 6}
476
+ {"time": 1794439482.6370761, "rss": 471924736, "processes": 6}
477
+ {"time": 1794439487.651608, "rss": 471707648, "processes": 6}
478
+ {"time": 1794439492.6652825, "rss": 471740416, "processes": 6}
479
+ {"time": 1794439497.6795888, "rss": 470335488, "processes": 6}
480
+ {"time": 1794439502.693557, "rss": 471089152, "processes": 6}
481
+ {"time": 1794439507.7086504, "rss": 470581248, "processes": 6}
482
+ {"time": 1794439512.7232842, "rss": 470818816, "processes": 6}
483
+ {"time": 1794439517.737324, "rss": 470491136, "processes": 6}
484
+ {"time": 1794439522.7521183, "rss": 471199744, "processes": 6}
485
+ {"time": 1794439527.7661712, "rss": 478158848, "processes": 6}
486
+ {"time": 1794439532.780289, "rss": 472805376, "processes": 6}
487
+ {"time": 1794439537.794783, "rss": 474517504, "processes": 6}
488
+ {"time": 1794439542.809536, "rss": 477093888, "processes": 6}
489
+ {"time": 1794439547.8240597, "rss": 476094464, "processes": 6}
490
+ {"time": 1794439552.8391128, "rss": 478679040, "processes": 6}
491
+ {"time": 1794439557.8542557, "rss": 476737536, "processes": 6}
492
+ {"time": 1794439562.8689399, "rss": 473817088, "processes": 6}
493
+ {"time": 1794439567.883129, "rss": 477294592, "processes": 6}
494
+ {"time": 1794439572.897449, "rss": 475799552, "processes": 6}
495
+ {"time": 1794439577.9121897, "rss": 475234304, "processes": 6}
496
+ {"time": 1794439582.927133, "rss": 475267072, "processes": 6}
497
+ {"time": 1794439587.9412885, "rss": 478093312, "processes": 6}
498
+ {"time": 1794439592.9556518, "rss": 476680192, "processes": 6}
499
+ {"time": 1794439597.968004, "rss": 478785536, "processes": 6}
500
+ {"time": 1794439602.982449, "rss": 481710080, "processes": 6}
501
+ {"time": 1794439607.9974768, "rss": 478928896, "processes": 6}
502
+ {"time": 1794439613.0117562, "rss": 478924800, "processes": 6}
503
+ {"time": 1794439618.0261002, "rss": 476897280, "processes": 6}
504
+ {"time": 1794439623.0407, "rss": 474218496, "processes": 6}
505
+ {"time": 1794439628.054914, "rss": 482254848, "processes": 6}
506
+ {"time": 1794439633.0692039, "rss": 483553280, "processes": 6}
507
+ {"time": 1794439638.084214, "rss": 481972224, "processes": 6}
508
+ {"time": 1794439643.0986624, "rss": 481284096, "processes": 6}
509
+ {"time": 1794439648.1132948, "rss": 480940032, "processes": 6}
510
+ {"time": 1794439653.1280847, "rss": 481107968, "processes": 6}
511
+ {"time": 1794439658.1431952, "rss": 483442688, "processes": 6}
512
+ {"time": 1794439663.1577737, "rss": 478932992, "processes": 6}
513
+ {"time": 1794439668.172748, "rss": 478257152, "processes": 6}
514
+ {"time": 1794439673.1874816, "rss": 487825408, "processes": 6}
515
+ {"time": 1794439678.2034404, "rss": 486068224, "processes": 6}
516
+ {"time": 1794439683.218179, "rss": 484466688, "processes": 6}
517
+ {"time": 1794439688.2328463, "rss": 487059456, "processes": 6}
518
+ {"time": 1794439693.247013, "rss": 485638144, "processes": 6}
519
+ {"time": 1794439698.2613642, "rss": 479916032, "processes": 6}
520
+ {"time": 1794439703.2761383, "rss": 483106816, "processes": 6}
521
+ {"time": 1794439708.2905312, "rss": 481644544, "processes": 6}
522
+ {"time": 1794439713.304484, "rss": 479088640, "processes": 6}
523
+ {"time": 1794439718.319502, "rss": 479375360, "processes": 6}
524
+ {"time": 1794439723.3336298, "rss": 478363648, "processes": 6}
525
+ {"time": 1794439728.347564, "rss": 478552064, "processes": 6}
526
+ {"time": 1794439733.36183, "rss": 478593024, "processes": 6}
527
+ {"time": 1794439738.3755636, "rss": 478654464, "processes": 6}
528
+ {"time": 1794439743.389807, "rss": 478457856, "processes": 6}
529
+ {"time": 1794439748.4039178, "rss": 479219712, "processes": 6}
530
+ {"time": 1794439753.4189115, "rss": 479297536, "processes": 6}
531
+ {"time": 1794439758.4334452, "rss": 478339072, "processes": 6}
532
+ {"time": 1794439763.4476604, "rss": 478347264, "processes": 6}
533
+ {"time": 1794439768.4616466, "rss": 478027776, "processes": 6}
534
+ {"time": 1794439773.476418, "rss": 487059456, "processes": 6}
535
+ {"time": 1794439778.4913335, "rss": 487010304, "processes": 6}
536
+ {"time": 1794439783.5060775, "rss": 485683200, "processes": 6}
537
+ {"time": 1794439788.521224, "rss": 485371904, "processes": 6}
538
+ {"time": 1794439793.5324533, "rss": 488136704, "processes": 6}
539
+ {"time": 1794439798.5434911, "rss": 487198720, "processes": 6}
540
+ {"time": 1794439803.5552237, "rss": 482484224, "processes": 6}
541
+ {"time": 1794439808.5681934, "rss": 482533376, "processes": 6}
542
+ {"time": 1794439813.5811627, "rss": 490500096, "processes": 6}
543
+ {"time": 1794439818.5934796, "rss": 506081280, "processes": 6}
544
+ {"time": 1794439823.6079671, "rss": 490835968, "processes": 6}
545
+ {"time": 1794439828.6228855, "rss": 488472576, "processes": 6}
546
+ {"time": 1794439833.6370547, "rss": 488144896, "processes": 6}
547
+ {"time": 1794439838.6511211, "rss": 484356096, "processes": 6}
548
+ {"time": 1794439843.6649826, "rss": 483631104, "processes": 6}
549
+ {"time": 1794439848.6784146, "rss": 499900416, "processes": 6}
550
+ {"time": 1794439853.6931155, "rss": 496361472, "processes": 6}
551
+ {"time": 1794439858.7085366, "rss": 494280704, "processes": 6}
552
+ {"time": 1794439863.7239356, "rss": 494325760, "processes": 6}
553
+ {"time": 1794439868.7387145, "rss": 492154880, "processes": 6}
554
+ {"time": 1794439873.754134, "rss": 489431040, "processes": 6}
555
+ {"time": 1794439878.7692008, "rss": 488181760, "processes": 6}
556
+ {"time": 1794439883.7793794, "rss": 487895040, "processes": 6}
557
+ {"time": 1794439888.7938044, "rss": 488337408, "processes": 6}
558
+ {"time": 1794439893.8088377, "rss": 488300544, "processes": 6}
559
+ {"time": 1794439898.823531, "rss": 497221632, "processes": 6}
560
+ {"time": 1794439903.8375213, "rss": 497582080, "processes": 6}
561
+ {"time": 1794439908.851753, "rss": 496353280, "processes": 6}
562
+ {"time": 1794439913.8668096, "rss": 490192896, "processes": 6}
563
+ {"time": 1794439918.8810291, "rss": 489615360, "processes": 6}
564
+ {"time": 1794439923.896701, "rss": 488349696, "processes": 6}
565
+ {"time": 1794439928.9123623, "rss": 497074176, "processes": 6}
566
+ {"time": 1794439933.9271553, "rss": 496807936, "processes": 6}
567
+ {"time": 1794439938.9412842, "rss": 496234496, "processes": 6}
568
+ {"time": 1794439943.955667, "rss": 495321088, "processes": 6}
569
+ {"time": 1794439948.9693103, "rss": 490876928, "processes": 6}
570
+ {"time": 1794439953.983706, "rss": 491384832, "processes": 6}
571
+ {"time": 1794439958.998529, "rss": 490119168, "processes": 6}
572
+ {"time": 1794439964.0130212, "rss": 489615360, "processes": 6}
573
+ {"time": 1794439969.027505, "rss": 491855872, "processes": 6}
574
+ {"time": 1794439974.0415454, "rss": 507092992, "processes": 6}
575
+ {"time": 1794439979.0561073, "rss": 502231040, "processes": 6}
576
+ {"time": 1794439984.0713115, "rss": 500244480, "processes": 6}
577
+ {"time": 1794439989.086391, "rss": 493522944, "processes": 6}
578
+ {"time": 1794439994.100931, "rss": 496160768, "processes": 6}
579
+ {"time": 1794439999.115844, "rss": 497004544, "processes": 6}
580
+ {"time": 1794440004.13036, "rss": 491278336, "processes": 6}
581
+ {"time": 1794440009.14454, "rss": 489009152, "processes": 6}
582
+ {"time": 1794440014.1588473, "rss": 490070016, "processes": 6}
583
+ {"time": 1794440019.173477, "rss": 489590784, "processes": 6}
584
+ {"time": 1794440024.187846, "rss": 491200512, "processes": 6}
585
+ {"time": 1794440029.20181, "rss": 490393600, "processes": 6}
586
+ {"time": 1794440034.2163796, "rss": 491274240, "processes": 6}
587
+ {"time": 1794440039.2308397, "rss": 486645760, "processes": 6}
588
+ {"time": 1794440044.2456532, "rss": 486670336, "processes": 6}
589
+ {"time": 1794440049.2596273, "rss": 485150720, "processes": 6}
590
+ {"time": 1794440054.2737904, "rss": 485142528, "processes": 6}
591
+ {"time": 1794440059.2880502, "rss": 484720640, "processes": 6}
592
+ {"time": 1794440064.3022058, "rss": 485957632, "processes": 6}
593
+ {"time": 1794440069.3167927, "rss": 485769216, "processes": 6}
594
+ {"time": 1794440074.33141, "rss": 485859328, "processes": 6}
595
+ {"time": 1794440079.3453982, "rss": 485380096, "processes": 6}
596
+ {"time": 1794440084.359906, "rss": 485912576, "processes": 6}
597
+ {"time": 1794440089.3738236, "rss": 485261312, "processes": 6}
598
+ {"time": 1794440094.3876588, "rss": 488611840, "processes": 6}
599
+ {"time": 1794440099.40287, "rss": 498733056, "processes": 6}
600
+ {"time": 1794440104.4175577, "rss": 494571520, "processes": 6}
601
+ {"time": 1794440109.432971, "rss": 494587904, "processes": 6}
602
+ {"time": 1794440114.4470203, "rss": 493568000, "processes": 6}
603
+ {"time": 1794440119.461326, "rss": 496971776, "processes": 6}
604
+ {"time": 1794440124.4762793, "rss": 500490240, "processes": 6}
605
+ {"time": 1794440129.4899747, "rss": 493207552, "processes": 6}
606
+ {"time": 1794440134.5050316, "rss": 493559808, "processes": 6}
607
+ {"time": 1794440139.5192418, "rss": 492941312, "processes": 6}
608
+ {"time": 1794440144.531733, "rss": 512872448, "processes": 6}
609
+ {"time": 1794440149.5441945, "rss": 495661056, "processes": 6}
610
+ {"time": 1794440154.5564115, "rss": 497119232, "processes": 6}
611
+ {"time": 1794440159.568814, "rss": 495185920, "processes": 6}
612
+ {"time": 1794440164.5827434, "rss": 496562176, "processes": 6}
613
+ {"time": 1794440169.5957603, "rss": 495665152, "processes": 6}
614
+ {"time": 1794440174.6101148, "rss": 494653440, "processes": 6}
615
+ {"time": 1794440179.624451, "rss": 497074176, "processes": 6}
616
+ {"time": 1794440184.6378088, "rss": 496156672, "processes": 6}
617
+ {"time": 1794440189.6519635, "rss": 498302976, "processes": 6}
618
+ {"time": 1794440194.6666038, "rss": 497721344, "processes": 6}
619
+ {"time": 1794440199.6816623, "rss": 497926144, "processes": 6}
620
+ {"time": 1794440204.6962557, "rss": 500371456, "processes": 6}
621
+ {"time": 1794440209.710804, "rss": 504242176, "processes": 6}
622
+ {"time": 1794440214.72489, "rss": 502374400, "processes": 6}
623
+ {"time": 1794440219.7391605, "rss": 501084160, "processes": 6}
624
+ {"time": 1794440224.7534096, "rss": 499048448, "processes": 6}
625
+ {"time": 1794440229.7678087, "rss": 491929600, "processes": 6}
626
+ {"time": 1794440234.7821412, "rss": 489263104, "processes": 6}
627
+ {"time": 1794440239.7944767, "rss": 580624384, "processes": 6}
628
+ {"time": 1794440244.8090775, "rss": 494219264, "processes": 6}
629
+ {"time": 1794440249.824049, "rss": 494993408, "processes": 6}
630
+ {"time": 1794440254.838094, "rss": 492646400, "processes": 6}
631
+ {"time": 1794440259.8519378, "rss": 496914432, "processes": 6}
632
+ {"time": 1794440264.865807, "rss": 495333376, "processes": 6}
633
+ {"time": 1794440269.8804731, "rss": 499331072, "processes": 6}
634
+ {"time": 1794440274.8952098, "rss": 501964800, "processes": 6}
635
+ {"time": 1794440279.9090338, "rss": 499240960, "processes": 6}
636
+ {"time": 1794440284.9231539, "rss": 496758784, "processes": 6}
637
+ {"time": 1794440289.9375362, "rss": 503529472, "processes": 6}
638
+ {"time": 1794440294.953103, "rss": 507596800, "processes": 6}
639
+ {"time": 1794440299.967823, "rss": 500862976, "processes": 6}
640
+ {"time": 1794440304.9798248, "rss": 503365632, "processes": 6}
641
+ {"time": 1794440309.9947517, "rss": 503111680, "processes": 6}
642
+ {"time": 1794440315.0093215, "rss": 501964800, "processes": 6}
643
+ {"time": 1794440320.0233936, "rss": 497520640, "processes": 6}
644
+ {"time": 1794440325.0374641, "rss": 497225728, "processes": 6}
645
+ {"time": 1794440330.0520384, "rss": 501284864, "processes": 6}
646
+ {"time": 1794440335.0659778, "rss": 499707904, "processes": 6}
647
+ {"time": 1794440340.0806432, "rss": 498069504, "processes": 6}
648
+ {"time": 1794440345.0942266, "rss": 496291840, "processes": 6}
649
+ {"time": 1794440350.1087084, "rss": 495702016, "processes": 6}
650
+ {"time": 1794440355.1226332, "rss": 495312896, "processes": 6}
651
+ {"time": 1794440360.1372998, "rss": 495005696, "processes": 6}
652
+ {"time": 1794440365.1514044, "rss": 495173632, "processes": 6}
653
+ {"time": 1794440370.165785, "rss": 494170112, "processes": 6}
654
+ {"time": 1794440375.1803553, "rss": 494161920, "processes": 6}
655
+ {"time": 1794440380.1947389, "rss": 493944832, "processes": 6}
656
+ {"time": 1794440385.2097707, "rss": 493850624, "processes": 6}
657
+ {"time": 1794440390.224039, "rss": 502345728, "processes": 6}
658
+ {"time": 1794440395.234918, "rss": 502906880, "processes": 6}
659
+ {"time": 1794440400.2495253, "rss": 497758208, "processes": 6}
660
+ {"time": 1794440405.2631073, "rss": 496533504, "processes": 6}
661
+ {"time": 1794440410.2776043, "rss": 496013312, "processes": 6}
662
+ {"time": 1794440415.2908065, "rss": 540205056, "processes": 6}
663
+ {"time": 1794440420.3047652, "rss": 590573568, "processes": 6}
664
+ {"time": 1794440425.3192298, "rss": 500039680, "processes": 6}
665
+ {"time": 1794440430.3328135, "rss": 497651712, "processes": 6}
666
+ {"time": 1794440435.347527, "rss": 497463296, "processes": 6}
667
+ {"time": 1794440440.360762, "rss": 1388154880, "processes": 6}
668
+ {"time": 1794440445.3734531, "rss": 1393426432, "processes": 6}
669
+ {"time": 1794440450.3865082, "rss": 1469960192, "processes": 6}
670
+ {"time": 1794440455.3998322, "rss": 1478619136, "processes": 6}
671
+ {"time": 1794440460.4132063, "rss": 501071872, "processes": 6}
672
+ {"time": 1794440465.4272935, "rss": 498343936, "processes": 6}
673
+ {"time": 1794440470.4423094, "rss": 496943104, "processes": 6}
674
+ {"time": 1794440475.4572139, "rss": 500273152, "processes": 6}
675
+ {"time": 1794440480.4711533, "rss": 498503680, "processes": 6}
676
+ {"time": 1794440485.485343, "rss": 498294784, "processes": 6}
677
+ {"time": 1794440490.499646, "rss": 499675136, "processes": 6}
678
+ {"time": 1794440495.5129166, "rss": 579317760, "processes": 6}
679
+ {"time": 1794440500.5247939, "rss": 502251520, "processes": 6}
680
+ {"time": 1794440505.5363157, "rss": 500793344, "processes": 6}
681
+ {"time": 1794440510.5494342, "rss": 498020352, "processes": 6}
682
+ {"time": 1794440515.5611658, "rss": 498167808, "processes": 6}
683
+ {"time": 1794440520.574788, "rss": 1449738240, "processes": 6}
684
+ {"time": 1794440525.589805, "rss": 1454731264, "processes": 6}
685
+ {"time": 1794440530.6030946, "rss": 1460948992, "processes": 6}
686
+ {"time": 1794440535.616238, "rss": 1462808576, "processes": 6}
687
+ {"time": 1794440540.6303673, "rss": 504832000, "processes": 6}
688
+ {"time": 1794440545.6443918, "rss": 1347674112, "processes": 6}
689
+ {"time": 1794440550.657345, "rss": 1346945024, "processes": 6}
690
+ {"time": 1794440555.6703532, "rss": 1382858752, "processes": 6}
691
+ {"time": 1794440560.6849556, "rss": 504610816, "processes": 6}
692
+ {"time": 1794440565.6988912, "rss": 503701504, "processes": 6}
693
+ {"time": 1794440570.7143035, "rss": 505765888, "processes": 6}
694
+ {"time": 1794440575.729092, "rss": 505782272, "processes": 6}
695
+ {"time": 1794440580.743859, "rss": 501149696, "processes": 6}
696
+ {"time": 1794440585.7576966, "rss": 501129216, "processes": 6}
697
+ {"time": 1794440590.772215, "rss": 500011008, "processes": 6}
698
+ {"time": 1794440595.7862008, "rss": 499748864, "processes": 6}
699
+ {"time": 1794440600.800726, "rss": 505548800, "processes": 6}
700
+ {"time": 1794440605.814763, "rss": 505249792, "processes": 6}
701
+ {"time": 1794440610.8289237, "rss": 502181888, "processes": 6}
702
+ {"time": 1794440615.8433459, "rss": 501899264, "processes": 6}
703
+ {"time": 1794440620.8574054, "rss": 504320000, "processes": 6}
704
+ {"time": 1794440625.8718574, "rss": 502235136, "processes": 6}
705
+ {"time": 1794440630.8863778, "rss": 500781056, "processes": 6}
706
+ {"time": 1794440635.900237, "rss": 509657088, "processes": 6}
707
+ {"time": 1794440640.914781, "rss": 509493248, "processes": 6}
708
+ {"time": 1794440645.9293633, "rss": 510447616, "processes": 6}
709
+ {"time": 1794440650.9434795, "rss": 515862528, "processes": 6}
710
+ {"time": 1794440655.9579637, "rss": 521535488, "processes": 6}
711
+ {"time": 1794440660.9720337, "rss": 519634944, "processes": 6}
712
+ {"time": 1794440665.98646, "rss": 517025792, "processes": 6}
713
+ {"time": 1794440671.0002854, "rss": 506707968, "processes": 6}
714
+ {"time": 1794440676.0144045, "rss": 506118144, "processes": 6}
715
+ {"time": 1794440681.0286014, "rss": 505577472, "processes": 6}
716
+ {"time": 1794440686.0426824, "rss": 505745408, "processes": 6}
717
+ {"time": 1794440691.056483, "rss": 505516032, "processes": 6}
718
+ {"time": 1794440696.0712147, "rss": 505237504, "processes": 6}
719
+ {"time": 1794440701.0860171, "rss": 505565184, "processes": 6}
720
+ {"time": 1794440706.1006014, "rss": 504532992, "processes": 6}
721
+ {"time": 1794440711.1143432, "rss": 505749504, "processes": 6}
722
+ {"time": 1794440716.1288695, "rss": 505688064, "processes": 6}
723
+ {"time": 1794440721.1434984, "rss": 518221824, "processes": 6}
724
+ {"time": 1794440726.1578293, "rss": 516337664, "processes": 6}
725
+ {"time": 1794440731.172134, "rss": 500858880, "processes": 6}
726
+ {"time": 1794440736.1867516, "rss": 501932032, "processes": 6}
727
+ {"time": 1794440741.2007678, "rss": 502243328, "processes": 6}
728
+ {"time": 1794440746.2154593, "rss": 501719040, "processes": 6}
729
+ {"time": 1794440751.2301211, "rss": 502272000, "processes": 6}
730
+ {"time": 1794440756.2441716, "rss": 498634752, "processes": 6}
731
+ {"time": 1794440761.2585516, "rss": 497819648, "processes": 6}
732
+ {"time": 1794440766.2730055, "rss": 497954816, "processes": 6}
733
+ {"time": 1794440771.2875876, "rss": 496304128, "processes": 6}
734
+ {"time": 1794440776.3028781, "rss": 497192960, "processes": 6}
735
+ {"time": 1794440781.3182392, "rss": 497004544, "processes": 6}
736
+ {"time": 1794440786.332524, "rss": 496607232, "processes": 6}
737
+ {"time": 1794440791.3468854, "rss": 495292416, "processes": 6}
738
+ {"time": 1794440796.3611324, "rss": 496443392, "processes": 6}
739
+ {"time": 1794440801.375263, "rss": 496144384, "processes": 6}
740
+ {"time": 1794440806.3894348, "rss": 496910336, "processes": 6}
741
+ {"time": 1794440811.4042077, "rss": 497647616, "processes": 6}
742
+ {"time": 1794440816.4192848, "rss": 517648384, "processes": 6}
743
+ {"time": 1794440821.433393, "rss": 507949056, "processes": 6}
744
+ {"time": 1794440826.4479082, "rss": 507305984, "processes": 6}
745
+ {"time": 1794440831.4623692, "rss": 510205952, "processes": 6}
746
+ {"time": 1794440836.4764354, "rss": 511324160, "processes": 6}
747
+ {"time": 1794440841.4907892, "rss": 510631936, "processes": 6}
748
+ {"time": 1794440846.50484, "rss": 508514304, "processes": 6}
749
+ {"time": 1794440851.5202818, "rss": 508571648, "processes": 6}
750
+ {"time": 1794440856.5333273, "rss": 506843136, "processes": 6}
751
+ {"time": 1794440861.5464692, "rss": 506105856, "processes": 6}
752
+ {"time": 1794440866.5600626, "rss": 504467456, "processes": 6}
753
+ {"time": 1794440871.5723255, "rss": 507133952, "processes": 6}
754
+ {"time": 1794440876.5850146, "rss": 510099456, "processes": 6}
755
+ {"time": 1794440881.5996723, "rss": 506195968, "processes": 6}
756
+ {"time": 1794440886.6145484, "rss": 509599744, "processes": 6}
757
+ {"time": 1794440891.6293087, "rss": 506810368, "processes": 6}
758
+ {"time": 1794440896.641877, "rss": 507592704, "processes": 6}
759
+ {"time": 1794440901.656656, "rss": 506703872, "processes": 6}
760
+ {"time": 1794440906.6710112, "rss": 508411904, "processes": 6}
761
+ {"time": 1794440911.6852555, "rss": 506880000, "processes": 6}
762
+ {"time": 1794440916.6990814, "rss": 512352256, "processes": 6}
763
+ {"time": 1794440921.7137182, "rss": 513683456, "processes": 6}
764
+ {"time": 1794440926.7271874, "rss": 513380352, "processes": 6}
765
+ {"time": 1794440931.74108, "rss": 511905792, "processes": 6}
766
+ {"time": 1794440936.755404, "rss": 506916864, "processes": 6}
767
+ {"time": 1794440941.7701836, "rss": 506286080, "processes": 6}
768
+ {"time": 1794440946.7848434, "rss": 511258624, "processes": 6}
769
+ {"time": 1794440951.7994506, "rss": 511725568, "processes": 6}
770
+ {"time": 1794440956.8126395, "rss": 515444736, "processes": 6}
771
+ {"time": 1794440961.8274467, "rss": 516132864, "processes": 6}
772
+ {"time": 1794440966.8424077, "rss": 521887744, "processes": 6}
773
+ {"time": 1794440971.8565488, "rss": 513449984, "processes": 6}
774
+ {"time": 1794440976.870518, "rss": 510640128, "processes": 6}
775
+ {"time": 1794440981.8845906, "rss": 510296064, "processes": 6}
776
+ {"time": 1794440986.8988686, "rss": 515538944, "processes": 6}
777
+ {"time": 1794440991.9136055, "rss": 516628480, "processes": 6}
778
+ {"time": 1794440996.9283926, "rss": 555319296, "processes": 6}
779
+ {"time": 1794441001.9409015, "rss": 515710976, "processes": 6}
780
+ {"time": 1794441006.9555547, "rss": 520445952, "processes": 6}
781
+ {"time": 1794441011.9704924, "rss": 519409664, "processes": 6}
782
+ {"time": 1794441016.9859438, "rss": 519352320, "processes": 6}
783
+ {"time": 1794441022.0007288, "rss": 518770688, "processes": 6}
784
+ {"time": 1794441027.0153697, "rss": 519741440, "processes": 6}
785
+ {"time": 1794441032.0299463, "rss": 512897024, "processes": 6}
786
+ {"time": 1794441037.043597, "rss": 513507328, "processes": 6}
787
+ {"time": 1794441042.058319, "rss": 518205440, "processes": 6}
788
+ {"time": 1794441047.072665, "rss": 516476928, "processes": 6}
789
+ {"time": 1794441052.0866067, "rss": 516628480, "processes": 6}
790
+ {"time": 1794441057.1009023, "rss": 517226496, "processes": 6}
791
+ {"time": 1794441062.1135364, "rss": 515792896, "processes": 6}
v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/.gitignore ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ node_modules
2
+ dist
3
+ coverage
4
+ LICENSE
5
+ *.tsbuildinfo
v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/README.md ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GBNF
2
+
3
+ A library for parsing `.gbnf` grammar files in TypeScript.
4
+
5
+ This package is a port of the Python `gbnf` package (version 0.0.30). The source layout, the
6
+ public behaviour and the test suites mirror the Python implementation one to one.
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ pnpm install
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```ts
17
+ import GBNF, { RuleChar, RuleCharExclude, RuleEnd } from 'gbnf';
18
+
19
+ // parse a grammar; the returned parse state lists the rules that are valid next
20
+ let state = GBNF('root ::= "yes" | "no"');
21
+
22
+ [...state].map(String); // ['RuleChar(value=[121])', 'RuleChar(value=[110])']
23
+
24
+ // feed input to the state; every call returns a new parse state
25
+ state = state.add('y');
26
+ [...state].map(String); // ['RuleChar(value=[101])']
27
+
28
+ // a parse state is also callable, as a shorthand for `add`
29
+ state = state('es');
30
+ [...state][0] instanceof RuleEnd; // true
31
+
32
+ // an initial string can be passed along with the grammar
33
+ GBNF('root ::= "yes" | "no"', 'ye'); // the state after consuming "ye"
34
+ ```
35
+
36
+ `GBNF(grammar, initialString = '')` returns a `ParseState`:
37
+
38
+ | member | description |
39
+ | --- | --- |
40
+ | `[Symbol.iterator]()` / `rules()` | the unique rules that are valid at the current position |
41
+ | `add(text)` | consumes `text` and returns a new `ParseState` |
42
+ | `state(text)` | calling the state is the same as `add(text)` |
43
+ | `size` | the number of unique rules |
44
+ | `grammar` | the grammar the state was built from |
45
+
46
+ The rules a state yields are instances of:
47
+
48
+ - `RuleChar` — `value` is a list of code points and inclusive `[lower, upper]` code point ranges
49
+ that are accepted next,
50
+ - `RuleCharExclude` — `value` is a list of code points and ranges that are *not* accepted next,
51
+ - `RuleEnd` — the input may end here.
52
+
53
+ Rules compare by value with `rule.equals(other)`, render like the Python implementation with
54
+ `String(rule)` (`RuleChar(value=[121])`) and serialize with `JSON.stringify(rule)`
55
+ (`{"type":"RuleChar","value":[121]}`).
56
+
57
+ ### Errors
58
+
59
+ - `GrammarParseError` (`grammar`, `pos`, `reason`) is thrown for an invalid grammar.
60
+ - `InputParseError` (`mostRecentInput`, `pos`, `previousInput`) is thrown by `GBNF(grammar, input)`,
61
+ `state.add(input)` and `state(input)` when the input is not valid for the grammar.
62
+
63
+ Both extend `Error`, carry a message pointing at the offending position, and can be compared with
64
+ `error.equals(other)`.
65
+
66
+ ```ts
67
+ import GBNF, { InputParseError } from 'gbnf';
68
+
69
+ try {
70
+ GBNF('root ::= "yes" | "no"', 'yesx');
71
+ } catch (err) {
72
+ if (err instanceof InputParseError) {
73
+ console.log(err.message);
74
+ // Failed to parse input string:
75
+ //
76
+ // yesx
77
+ // ^
78
+ }
79
+ }
80
+ ```
81
+
82
+ ## Development
83
+
84
+ ```bash
85
+ pnpm test # all tests (vitest run)
86
+ pnpm test:unit # unit tests, colocated with the sources (src/**/*.test.ts)
87
+ pnpm test:integration # integration tests (tests/generated)
88
+ pnpm build # compile to dist/ (requires typescript)
89
+ ```
90
+
91
+ `npx vitest run` works as well, also for a single file: `npx vitest run src/rules-builder`.
92
+
93
+ ## Layout
94
+
95
+ The modules map onto the Python package file by file; names are converted from `snake_case` to
96
+ `kebab-case` files and `camelCase` identifiers.
97
+
98
+ | Python | TypeScript |
99
+ | --- | --- |
100
+ | `gbnf/__init__.py`, `gbnf/gbnf.py` | `src/index.ts`, `src/gbnf.ts` |
101
+ | `gbnf/grammar_graph/*.py` | `src/grammar-graph/*.ts` |
102
+ | `gbnf/grammar_parser/build_rule_stack.py` | `src/grammar-parser/build-rule-stack.ts` |
103
+ | `gbnf/rules_builder/*.py` | `src/rules-builder/*.ts` |
104
+ | `gbnf/utils/**/*.py` | `src/utils/**/*.ts` |
105
+ | `gbnf/**/*_test.py` | `src/**/*.test.ts` |
106
+ | `tests/generated/**/*_test.py` | `tests/generated/**/*.test.ts` |
107
+
108
+ `src/utils/python-compat.ts` has no Python counterpart. It holds the few helpers that reproduce
109
+ Python semantics the implementation depends on: indexing and slicing strings by code point,
110
+ `repr` / `str` formatting used in messages, `int(x, 16)`, `str.isspace` and deep equality.
111
+
112
+ Test names are kept as they are in the Python suites (`describe_…`, `test_…`), and every
113
+ parametrized case is a test of its own, so the results of the two suites can be compared directly.
114
+
115
+ ## Differences from the Python implementation
116
+
117
+ The port follows the Python implementation as closely as the language allows, including its quirks.
118
+ Where Python constructs have no direct equivalent the following applies:
119
+
120
+ - **Operators.** `state + "text"` (`__add__`) is `state.add('text')`; `state("text")` (`__call__`)
121
+ is supported as is. `len(state)` is `state.size`, `rule == other` is `rule.equals(other)`,
122
+ `str(x)` is `String(x)` and `rule.__dict__` is `rule.toJSON()`.
123
+ - **Exceptions.** `GrammarParseError` and `InputParseError` are ported as classes. Built-in Python
124
+ exceptions that escape the library map onto the closest JavaScript error:
125
+
126
+ | Python | TypeScript |
127
+ | --- | --- |
128
+ | `ValueError` | `Error` |
129
+ | `IndexError` (e.g. the unterminated grammar `root ::= "a`) | `RangeError` |
130
+ | `KeyError` (a grammar without a `root` rule) | `Error` with the message `KeyError: 'root'` |
131
+ | `AttributeError` (printing a graph that contains `RuleEnd` / `RuleCharExclude` nodes) | `TypeError` |
132
+ | `RecursionError` (infinitely recursive grammars such as `root ::= ("x")?*`) | `RangeError` (maximum call stack size exceeded) |
133
+
134
+ - **Strings.** Positions are counted in code points, as in Python, not in UTF-16 code units.
135
+ - **Ordering of rules.** The Python implementation keeps the nodes a rule reference points at in a
136
+ `set` of objects, whose iteration order depends on memory addresses. Here those nodes are kept in
137
+ insertion order. The *set* of rules of a parse state is always the same as in Python; where the
138
+ order differs, the Python order is not deterministic to begin with.
v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/package.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "gbnf",
3
+ "version": "0.0.30",
4
+ "description": "A library for parsing GBNF grammars",
5
+ "license": "MIT",
6
+ "author": "Ambient Labs <maintainers@gbnf.dev>",
7
+ "homepage": "https://github.com/ambient-labs/GBNF/packages/gbnf",
8
+ "bugs": "https://github.com/ambient-labs/GBNF/packages/gbnf/issues",
9
+ "type": "module",
10
+ "main": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "README.md"
21
+ ],
22
+ "scripts": {
23
+ "build": "tsc -p tsconfig.build.json",
24
+ "typecheck": "tsc -p tsconfig.json --noEmit",
25
+ "test": "vitest run",
26
+ "test:unit": "vitest run src",
27
+ "test:unit:watch": "vitest src",
28
+ "test:integration": "vitest run tests/generated"
29
+ },
30
+ "devDependencies": {
31
+ "@types/node": "^22.0.0",
32
+ "typescript": "^5.6.0",
33
+ "vitest": "^2.1.3"
34
+ },
35
+ "engines": {
36
+ "node": ">=18"
37
+ }
38
+ }
v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/gbnf.ts ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { Graph } from './grammar-graph/graph.js';
2
+ import { ParseState } from './grammar-graph/parse-state.js';
3
+ import { buildRuleStack } from './grammar-parser/build-rule-stack.js';
4
+ import { GrammarParseError, RulesBuilder } from './rules-builder/index.js';
5
+
6
+ // ValidInput = string | number | number[]
7
+
8
+ export const GBNF = (grammar: string, initialString = ''): ParseState => {
9
+ if (typeof grammar !== 'string') {
10
+ throw new Error('grammar must be a string');
11
+ }
12
+
13
+ if (typeof initialString !== 'string') {
14
+ throw new Error('input must be a string');
15
+ }
16
+
17
+ const rulesBuilder = new RulesBuilder(grammar);
18
+ const { rules, symbolIds } = rulesBuilder;
19
+ if (rules.length === 0) {
20
+ throw new GrammarParseError(grammar, 0, 'No rules were found');
21
+ }
22
+ // As in the reference implementation, looking up a missing "root" symbol throws
23
+ // before this check gets a chance to report it as a grammar error.
24
+ if (symbolIds.get('root') === null) {
25
+ throw new GrammarParseError(grammar, 0, "Grammar does not contain a 'root' symbol");
26
+ }
27
+ const rootId: number = symbolIds.get('root');
28
+
29
+ const stackedRules = rules.map(rule => buildRuleStack(rule));
30
+ const graph = new Graph(grammar, stackedRules, rootId);
31
+ return new ParseState(graph, graph.add(initialString));
32
+ };
33
+
34
+ export default GBNF;
v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/grammar-graph/colorize.test.ts ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { expect, test } from 'vitest';
2
+
3
+ import { Color, colorize } from './colorize.js';
4
+
5
+ test('test_colorize_strings', () => {
6
+ expect(colorize('hello', Color.BLUE)).toBe('\x1b[34mhello');
7
+ expect(colorize('test', Color.CYAN)).toBe('\x1b[36mtest');
8
+ expect(colorize('example', Color.GREEN)).toBe('\x1b[32mexample');
9
+ });
10
+
11
+ test('test_colorize_numbers', () => {
12
+ expect(colorize(123, Color.RED)).toBe('\x1b[31m123');
13
+ expect(colorize(456, Color.GRAY)).toBe('\x1b[90m456');
14
+ expect(colorize(789, Color.YELLOW)).toBe('\x1b[33m789');
15
+ });
v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/grammar-graph/colorize.ts ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ export const Color = {
2
+ BLUE: '\x1b[34m',
3
+ CYAN: '\x1b[36m',
4
+ GREEN: '\x1b[32m',
5
+ RED: '\x1b[31m',
6
+ GRAY: '\x1b[90m',
7
+ YELLOW: '\x1b[33m',
8
+ } as const;
9
+
10
+ export const colorize = (text: string | number, color: string): string => `${color}${text}`;
v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/grammar-graph/get-input-as-code-points.test.ts ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { describe, expect, test } from 'vitest';
2
+
3
+ import { getInputAsCodePoints } from './get-input-as-code-points.js';
4
+
5
+ describe('describe_get_input_as_code_points', () => {
6
+ test('it_returns_code_points_for_string', () => {
7
+ expect(getInputAsCodePoints('abc')).toEqual([97, 98, 99]);
8
+ });
9
+
10
+ test('it_returns_code_points_for_number', () => {
11
+ expect(getInputAsCodePoints(99)).toEqual([99]);
12
+ });
13
+
14
+ test('it_returns_code_points_for_array_of_number', () => {
15
+ expect(getInputAsCodePoints([99, 100, 101])).toEqual([99, 100, 101]);
16
+ });
17
+ });
v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/grammar-graph/get-input-as-code-points.ts ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { str, typeName } from '../utils/python-compat.js';
2
+ import type { ValidInput } from './grammar-graph-types.js';
3
+
4
+ const getCodePoint = (char: string): number => {
5
+ const codePoint = char.codePointAt(0);
6
+ if (codePoint === undefined) {
7
+ throw new Error(`Could not get code point for character: ${char}`);
8
+ }
9
+ if (!Number.isInteger(codePoint)) {
10
+ throw new Error('code_point must be an integer!');
11
+ }
12
+ return codePoint;
13
+ };
14
+
15
+ export const getInputAsCodePoints = (src: ValidInput): number[] => {
16
+ if (typeof src === 'number' && Number.isInteger(src)) {
17
+ return [src];
18
+ }
19
+
20
+ if (Array.isArray(src)) {
21
+ for (const c of src) {
22
+ if (!Number.isInteger(c)) {
23
+ throw new Error(`code_point must be an integer for ${str(c)} if src is a list`);
24
+ }
25
+ }
26
+ return src;
27
+ }
28
+
29
+ if (typeof src === 'string') {
30
+ return Array.from(src, getCodePoint);
31
+ }
32
+
33
+ throw new Error(`Invalid input type: <class '${typeName(src)}'>`);
34
+ };
v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/grammar-graph/get-parent-stack-id.test.ts ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { describe, expect, test } from 'vitest';
2
+
3
+ import { Color } from './colorize.js';
4
+ import { getParentStackId } from './get-parent-stack-id.js';
5
+ import { RuleEnd } from './grammar-graph-types.js';
6
+ import { GraphNode } from './graph-node.js';
7
+ import { GraphPointer } from './graph-pointer.js';
8
+
9
+ const s = (str: string): string => JSON.stringify(str);
10
+
11
+ const mockColorize = (text: string | number, color: string): string => `[${s(color)}]:${text}`;
12
+
13
+ const red = s(Color.RED);
14
+ const gray = s(Color.GRAY);
15
+
16
+ const createMockPointer = (
17
+ stackId: number,
18
+ pathId: number,
19
+ stepId: number,
20
+ parent: GraphPointer | null = null,
21
+ ): GraphPointer => new GraphPointer(
22
+ new GraphNode(
23
+ new RuleEnd(),
24
+ {
25
+ stackId,
26
+ pathId,
27
+ stepId,
28
+ },
29
+ ),
30
+ parent,
31
+ );
32
+
33
+ describe('describe_get_parent_stack_id', () => {
34
+ test('test_returns_an_empty_string_if_no_parents', () => {
35
+ const pointer = createMockPointer(1, 1, 1);
36
+ const result = getParentStackId(pointer, mockColorize);
37
+ expect(result).toBe('');
38
+ });
39
+
40
+ test('test_returns_a_single_parent_id_colored_correctly', () => {
41
+ const parentPointer = createMockPointer(1, 1, 1);
42
+ const pointer = createMockPointer(2, 2, 2, parentPointer);
43
+ const result = getParentStackId(pointer, mockColorize);
44
+ expect(result).toBe(`[${red}]:1,1,1`);
45
+ });
46
+
47
+ test('test_returns_multiple_parent_ids_separated_by_colored_arrows', () => {
48
+ const grandparentPointer = createMockPointer(0, 0, 0);
49
+ const parentPointer = createMockPointer(1, 1, 1, grandparentPointer);
50
+ const pointer = createMockPointer(2, 2, 2, parentPointer);
51
+ const result = getParentStackId(pointer, mockColorize);
52
+ expect(result).toBe(`[${red}]:1,1,1[${gray}]:<-[${red}]:0,0,0`);
53
+ });
54
+
55
+ test('test_handles_deep_nesting_of_pointers', () => {
56
+ const greatGrandparentPointer = createMockPointer(0, 0, 0);
57
+ const grandparentPointer = createMockPointer(1, 1, 1, greatGrandparentPointer);
58
+ const parentPointer = createMockPointer(2, 2, 2, grandparentPointer);
59
+ const pointer = createMockPointer(3, 3, 3, parentPointer);
60
+ const result = getParentStackId(pointer, mockColorize);
61
+ const expectedOutput = `[${red}]:2,2,2[${gray}]:<-[${red}]:1,1,1[${gray}]:<-[${red}]:0,0,0`;
62
+ expect(result).toBe(expectedOutput);
63
+ });
64
+ });
v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/grammar-graph/get-parent-stack-id.ts ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { Color } from './colorize.js';
2
+ import type { GraphPointer } from './graph-pointer.js';
3
+
4
+ export const getParentStackId = (
5
+ pointer: GraphPointer,
6
+ col: (text: string | number, color: string) => string,
7
+ ): string => {
8
+ const stackIds: string[] = [];
9
+ let parent: GraphPointer | null = pointer.parent;
10
+ while (parent) {
11
+ stackIds.push(`${parent.node.meta.stackId},${parent.node.meta.pathId},${parent.node.meta.stepId}`);
12
+ parent = parent.parent;
13
+ }
14
+ const arrow = col('<-', Color.GRAY);
15
+ return stackIds.map(stackId => col(stackId, Color.RED)).join(arrow);
16
+ };
v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/grammar-graph/get-serialized-rule-key.test.ts ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ beforeEach,
3
+ describe,
4
+ expect,
5
+ test,
6
+ vi,
7
+ } from 'vitest';
8
+
9
+ import { KEY_TRANSLATION, getSerializedRuleKey } from './get-serialized-rule-key.js';
10
+ import {
11
+ RuleChar,
12
+ RuleCharExclude,
13
+ RuleEnd,
14
+ RuleRef,
15
+ type UnresolvedRule,
16
+ } from './grammar-graph-types.js';
17
+ import {
18
+ isRuleChar,
19
+ isRuleCharExclude,
20
+ isRuleEnd,
21
+ isRuleRef,
22
+ } from './type-guards.js';
23
+
24
+ vi.mock('./type-guards.js', async (importOriginal) => ({
25
+ ...await importOriginal<typeof import('./type-guards.js')>(),
26
+ isRuleEnd: vi.fn(),
27
+ isRuleChar: vi.fn(),
28
+ isRuleCharExclude: vi.fn(),
29
+ isRuleRef: vi.fn(),
30
+ }));
31
+
32
+ const mockIsRuleEnd = vi.mocked(isRuleEnd);
33
+ const mockIsRuleChar = vi.mocked(isRuleChar);
34
+ const mockIsRuleCharExclude = vi.mocked(isRuleCharExclude);
35
+ const mockIsRuleRef = vi.mocked(isRuleRef);
36
+
37
+ beforeEach(() => {
38
+ mockIsRuleEnd.mockReset().mockReturnValue(false);
39
+ mockIsRuleChar.mockReset().mockReturnValue(false);
40
+ mockIsRuleCharExclude.mockReset().mockReturnValue(false);
41
+ mockIsRuleRef.mockReset().mockReturnValue(false);
42
+ });
43
+
44
+ describe('describe_get_serialized_rule_key', () => {
45
+ test('test_returns_type_for_end_rules', () => {
46
+ mockIsRuleEnd.mockReturnValue(true);
47
+ const rule = new RuleEnd();
48
+ expect(getSerializedRuleKey(rule)).toBe(`${KEY_TRANSLATION.get(RuleEnd)}`);
49
+ });
50
+
51
+ test('test_returns_type_and_value_for_character_rules', () => {
52
+ mockIsRuleChar.mockReturnValue(true);
53
+ const rule = new RuleChar([97]);
54
+ expect(getSerializedRuleKey(rule)).toBe(`${KEY_TRANSLATION.get(RuleChar)}-[97]`);
55
+ });
56
+
57
+ test('test_returns_type_and_value_for_character_exclude_rules', () => {
58
+ mockIsRuleCharExclude.mockReturnValue(true);
59
+ const rule = new RuleCharExclude([97]);
60
+ expect(getSerializedRuleKey(rule)).toBe(`${KEY_TRANSLATION.get(RuleCharExclude)}-[97]`);
61
+ });
62
+
63
+ test('test_returns_ref_type_with_value_for_reference_rules', () => {
64
+ mockIsRuleRef.mockReturnValue(true);
65
+ const rule = new RuleRef(99);
66
+ expect(getSerializedRuleKey(rule)).toBe('3-99');
67
+ });
68
+
69
+ test('test_throws_error_for_unknown_rule_types', () => {
70
+ mockIsRuleEnd.mockReturnValue(false);
71
+ mockIsRuleChar.mockReturnValue(false);
72
+ mockIsRuleCharExclude.mockReturnValue(false);
73
+ mockIsRuleRef.mockReturnValue(false);
74
+ const rule = { type: 'UNKNOWN', value: 'something' } as unknown as UnresolvedRule;
75
+ expect(() => getSerializedRuleKey(rule)).toThrow(
76
+ "Unknown rule type: {'type': 'UNKNOWN', 'value': 'something'}",
77
+ );
78
+ });
79
+ });
v2-models-effort/runs/20261111-214430-flat-disk/ported_implementation/src/grammar-graph/get-serialized-rule-key.ts ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { jsonDumps, str } from '../utils/python-compat.js';
2
+ import {
3
+ RuleChar,
4
+ RuleCharExclude,
5
+ RuleEnd,
6
+ type UnresolvedRule,
7
+ } from './grammar-graph-types.js';
8
+ import {
9
+ isRuleChar,
10
+ isRuleCharExclude,
11
+ isRuleEnd,
12
+ isRuleRef,
13
+ } from './type-guards.js';
14
+
15
+ export const KEY_TRANSLATION = new Map<typeof RuleEnd | typeof RuleChar | typeof RuleCharExclude, number>([
16
+ [RuleEnd, 0],
17
+ [RuleChar, 1],
18
+ [RuleCharExclude, 2],
19
+ ]);
20
+
21
+ export const getSerializedRuleKey = (rule: UnresolvedRule): string => {
22
+ if (isRuleEnd(rule)) {
23
+ return `${KEY_TRANSLATION.get(RuleEnd)}`;
24
+ }
25
+
26
+ if (isRuleChar(rule)) {
27
+ return `${KEY_TRANSLATION.get(RuleChar)}-${jsonDumps(rule.value)}`;
28
+ }
29
+
30
+ if (isRuleCharExclude(rule)) {
31
+ return `${KEY_TRANSLATION.get(RuleCharExclude)}-${jsonDumps(rule.value)}`;
32
+ }
33
+
34
+ if (isRuleRef(rule)) {
35
+ return `3-${rule.value}`;
36
+ }
37
+
38
+ throw new Error(`Unknown rule type: ${str(rule)}`);
39
+ };