diff --git a/experiments/token-efficiency-heldout-v2/REPORT.md b/experiments/token-efficiency-heldout-v2/REPORT.md new file mode 100644 index 0000000..128ef20 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/REPORT.md @@ -0,0 +1,110 @@ +# Held-out-v2 token benchmark: baseline on main `576c87c1` + +This is a measurement only, taken **before any control-flow change**. It is the +"before" number that the next control-flow slice must beat on this set. The +specs (`tasks/`) were written by Hange (R&D seat) and frozen at `b3d67091`; they +are untouched here (`TestHeldoutV2SpecsFrozen`). No language feature, opcode, +capability or effect was added. Production `-compile-bc`/HFIR defaults are +unchanged, #90 stays Partial, and no live LLM was used. + +## Headline + +**HowlFrame loses to Python on held-out v2, clearly. It wins 2 of 37 tasks.** + +| Comparison (cl100k_base) | Median per-task ratio | Ratio of medians | Total-token ratio | W/T/L | +|---|---|---|---|---| +| HowlFrame vs Python | 1.306 | 1.295 | 1.324 (4084 / 3084) | 2/0/35 | +| HowlFrame vs JS | 1.136 | 1.110 | 1.167 (4084 / 3500) | 7/2/28 | +| HowlFrame vs Go | 0.590 | 0.558 | 0.586 (4084 / 6972) | 37/0/0 | + +o200k_base: vs Python 1.306 median / 1.321 total (2/0/35); vs JS 1.083 / 1.112 +(10/1/26); vs Go 0.582 / 0.583 (37/0/0). + +All 148 references (37 tasks x 4 languages) pass the verifier. `gaps.json` is +empty: every task is expressible in current HowlFrame, but many only through +workarounds (below), which is where the tokens go. + +## Per category (cl100k_base, HowlFrame / Python) + +| Category | n | Median per-task | Total-token | +|---|---|---|---| +| text | 4 | 1.254 | 1.314 | +| table | 4 | 1.279 | 1.378 | +| numbers | 4 | 1.433 | 1.470 | +| lists | 4 | 1.423 | 1.391 | +| strings | 4 | 1.344 | 1.321 | +| records | 4 | 1.190 | 1.242 | +| **logic** | 13 | **1.244** | **1.290** | + +## Per task (cl100k_base tokens) + +| Task | Cat | howl | py | js | go | howl/py | +|---|---|---|---|---|---|---| +| w01 | text | 111 | 95 | 106 | 168 | 1.17 | +| w02 | text | 79 | 59 | 61 | 133 | 1.34 | +| w03 | text | 104 | 57 | 64 | 143 | 1.82 | +| w04 | text | 66 | 63 | 80 | 163 | 1.05 | +| w05 | table | 98 | 76 | 88 | 177 | 1.29 | +| w06 | table | 97 | 79 | 101 | 179 | 1.23 | +| w07 | table | 104 | 82 | 91 | 202 | 1.27 | +| w08 | table | 135 | 78 | 86 | 181 | 1.73 | +| w09 | numbers | 56 | 50 | 61 | 150 | 1.12 | +| w10 | numbers | 117 | 80 | 108 | 166 | 1.46 | +| w11 | numbers | 139 | 79 | 127 | 220 | 1.76 | +| w12 | numbers | 101 | 72 | 97 | 206 | 1.40 | +| w13 | lists | 79 | 62 | 78 | 171 | 1.27 | +| w14 | lists | 123 | 86 | 105 | 221 | 1.43 | +| w15 | lists | 94 | 66 | 74 | 205 | 1.42 | +| w16 | lists | 81 | 57 | 59 | 164 | 1.42 | +| w17 | strings | 92 | 57 | 62 | 156 | 1.61 | +| w18 | strings | 64 | 63 | 64 | 165 | 1.02 | +| w19 | strings | 91 | 69 | 73 | 129 | 1.32 | +| w20 | strings | 78 | 57 | 61 | 125 | 1.37 | +| w21 | records | 99 | 65 | 69 | 174 | 1.52 | +| w22 | records | 99 | 88 | 104 | 226 | 1.12 | +| w23 | records | 90 | 78 | 83 | 198 | 1.15 | +| w24 | records | 92 | 75 | 81 | 190 | 1.23 | +| w25 | logic | 128 | 77 | 102 | 188 | 1.66 | +| w26 | logic | 94 | 72 | 76 | 157 | 1.31 | +| w27 | logic | 91 | 95 | 98 | 184 | **0.96** | +| w28 | logic | 146 | 133 | 155 | 229 | 1.10 | +| w29 | logic | 108 | 90 | 118 | 214 | 1.20 | +| w30 | logic | 163 | 140 | 147 | 254 | 1.16 | +| w31 | logic | 104 | 49 | 54 | 151 | 2.12 | +| w32 | logic | 142 | 124 | 142 | 232 | 1.15 | +| w33 | logic | 143 | 95 | 113 | 252 | 1.51 | +| w34 | logic | 227 | 145 | 123 | 250 | 1.57 | +| w35 | logic | 140 | 100 | 123 | 230 | 1.40 | +| w36 | logic | 110 | 111 | 98 | 179 | **0.99** | +| w37 | logic | 199 | 160 | 168 | 240 | 1.24 | + +## Workarounds forced by current HowlFrame (observations, not fixes) + +Recorded so the next slice can be judged against them; none was implemented. + +- No modulo / integer division: `(- n (* d (to_int (/ n d))))` everywhere + (w10, w15, w25-w27, w31, w32). `/` returns a float. +- No early exit (`break`/`return` from a loop): result flags plus guarded + loops (w28, w29, w35). +- No range/index iteration: manual `while` counters (w12-w16, w34, w35). +- No negative integer literal: `(- 0 1)` (w34). +- No char code / translate: alphabet `index_of` table (w19). No base + formatting (w31). No right-trim, pad or repeat (w03, w08, w20). +- No sort by key: distinct-scores loop for w33. `map_keys` returns sorted + string keys, so numeric buckets needed a counted loop (w11). +- Multi-line indentation is counted like every prior set (v1 style). + +## Method + +Unchanged from heldout-v1: `cmd/heldoutv2verify` (fresh sandbox, governed +build, `-run-bc` with only `filesystem:read=in`/`filesystem:write=out`, exact +output-file check, sha256 per source), tiktoken 0.8.0 (`requirements.txt`), +`count_tokens.py` reusing the v0 stripping rules. References are idiomatic, +standard library only, no comments. Reproduce with `./run.sh`; outputs are +byte-identical across reruns. + +## Freeze + +`results_freeze_test.go` pins sha256 of `gaps.json` and every file in +`results/`. `verification_test.go` checks every task x language is verified +with a current hash. diff --git a/experiments/token-efficiency-heldout-v2/cmd/heldoutv2verify/main.go b/experiments/token-efficiency-heldout-v2/cmd/heldoutv2verify/main.go new file mode 100644 index 0000000..07f2574 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/cmd/heldoutv2verify/main.go @@ -0,0 +1,213 @@ +// Command heldoutverify replays every held-out reference in a fresh sandbox +// and compares its single output with the frozen expected value. +package main + +import ( + "bytes" + "context" + "crypto/sha256" + "encoding/json" + "flag" + "fmt" + "io/fs" + "os" + "os/exec" + "path/filepath" + "reflect" + "sort" + "strings" + "time" +) + +type Task struct { + ID string `json:"id"` + Category string `json:"category"` + Inputs map[string]string `json:"inputs"` + Output string `json:"output"` + Kind string `json:"kind"` + Expected json.RawMessage `json:"expected"` +} + +type Gap struct { + Task string `json:"task"` + Lang string `json:"lang"` + Reason string `json:"reason"` +} + +type Result struct { + Task string `json:"task"` + Lang string `json:"lang"` + Pass bool `json:"pass"` + SHA256 string `json:"sha256"` + Detail string `json:"detail,omitempty"` +} + +var exts = map[string]string{"howl": "howl", "python": "py", "js": "js", "go": "go"} + +func main() { + root := flag.String("root", "experiments/token-efficiency-heldout-v2", "benchmark root") + howl := flag.String("howlframe", "/tmp/howlframe", "HowlFrame binary") + flag.Parse() + var manifest struct{ Tasks []Task } + must(readJSON(filepath.Join(*root, "tasks/manifest.json"), &manifest)) + var gaps []Gap + must(readJSON(filepath.Join(*root, "gaps.json"), &gaps)) + gapped := map[string]bool{} + for _, g := range gaps { + gapped[g.Task+"/"+g.Lang] = true + } + work, err := os.MkdirTemp("", "hf-heldout-verify-") + must(err) + fmt.Println("Replay artifacts:", work) + var results []Result + failed := false + for _, lang := range []string{"howl", "python", "js", "go"} { + passed, total := 0, 0 + for _, t := range manifest.Tasks { + if gapped[t.ID+"/"+lang] { + continue + } + total++ + src, _ := filepath.Abs(filepath.Join(*root, "solutions", lang, t.ID+"."+exts[lang])) + data, readErr := os.ReadFile(src) + r := Result{Task: t.ID, Lang: lang, SHA256: fmt.Sprintf("%x", sha256.Sum256(data))} + if readErr != nil { + r.Detail = readErr.Error() + } else { + r.Detail = verify(filepath.Join(work, lang+"-"+t.ID), src, lang, *howl, t) + r.Pass = r.Detail == "" + } + if r.Pass { + passed++ + } else { + failed = true + } + fmt.Printf("%s %s pass=%v %s\n", lang, t.ID, r.Pass, r.Detail) + results = append(results, r) + } + fmt.Printf("%s: %d/%d passed\n", lang, passed, total) + } + out, _ := json.MarshalIndent(results, "", " ") + must(os.MkdirAll(filepath.Join(*root, "results"), 0o755)) + must(os.WriteFile(filepath.Join(*root, "results/verification.json"), append(out, '\n'), 0o644)) + if failed { + os.Exit(1) + } +} + +func verify(dir, src, lang, howl string, t Task) string { + if err := os.MkdirAll(filepath.Join(dir, "out"), 0o755); err != nil { + return err.Error() + } + for p, content := range t.Inputs { + full := filepath.Join(dir, p) + os.MkdirAll(filepath.Dir(full), 0o755) + if err := os.WriteFile(full, []byte(content), 0o644); err != nil { + return err.Error() + } + } + absDir, _ := filepath.Abs(dir) + var cmd []string + switch lang { + case "howl": + art := filepath.Join(filepath.Dir(absDir), filepath.Base(absDir)+".hfbc") + if o, err := run(absDir, 30*time.Second, howl, "build", "--profile", "governed", src, "-o", art); err != nil { + return "build: " + o + } + cmd = []string{howl, "-run-bc", "-allow-caps", "filesystem:read=" + filepath.Join(absDir, "in") + ",filesystem:write=" + filepath.Join(absDir, "out"), art} + case "python": + cmd = []string{"python3", src} + case "js": + cmd = []string{"node", src} + case "go": + bin := absDir + ".bin" + if o, err := run(filepath.Dir(absDir), 60*time.Second, "go", "build", "-o", bin, src); err != nil { + return "go build: " + o + } + cmd = []string{bin} + } + if o, err := run(absDir, 10*time.Second, cmd[0], cmd[1:]...); err != nil { + return "run: " + o + } + // Exactly the inputs (unchanged) plus the one output may exist. + var files []string + filepath.WalkDir(absDir, func(p string, d fs.DirEntry, err error) error { + if err == nil && !d.IsDir() { + rel, _ := filepath.Rel(absDir, p) + files = append(files, filepath.ToSlash(rel)) + } + return nil + }) + want := []string{t.Output} + for p := range t.Inputs { + want = append(want, p) + } + sort.Strings(files) + sort.Strings(want) + if !reflect.DeepEqual(files, want) { + return fmt.Sprintf("file set %v, want %v", files, want) + } + for p, content := range t.Inputs { + got, _ := os.ReadFile(filepath.Join(absDir, p)) + if string(got) != content { + return "input modified: " + p + } + } + got, err := os.ReadFile(filepath.Join(absDir, t.Output)) + if err != nil { + return err.Error() + } + return compare(got, t) +} + +func compare(got []byte, t Task) string { + if t.Kind == "text" { + var want string + json.Unmarshal(t.Expected, &want) + g := strings.TrimRight(string(got), "\n") + if g != strings.TrimRight(want, "\n") { + return fmt.Sprintf("text mismatch: got %q want %q", g, want) + } + return "" + } + var g, w any + if err := json.Unmarshal(got, &g); err != nil { + return "invalid JSON output: " + err.Error() + } + json.Unmarshal(t.Expected, &w) + if !reflect.DeepEqual(g, w) { + return fmt.Sprintf("json mismatch: got %s want %s", bytes.TrimSpace(got), t.Expected) + } + return "" +} + +func run(dir string, timeout time.Duration, name string, args ...string) (string, error) { + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + c := exec.CommandContext(ctx, name, args...) + c.Dir = dir + out, err := c.CombinedOutput() + if ctx.Err() != nil { + return "timeout", ctx.Err() + } + s := string(out) + if len(s) > 400 { + s = s[:400] + } + return s, err +} + +func readJSON(path string, v any) error { + data, err := os.ReadFile(path) + if err != nil { + return err + } + return json.Unmarshal(data, v) +} + +func must(err error) { + if err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(2) + } +} diff --git a/experiments/token-efficiency-heldout-v2/count_tokens.py b/experiments/token-efficiency-heldout-v2/count_tokens.py new file mode 100644 index 0000000..27c5e13 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/count_tokens.py @@ -0,0 +1,82 @@ +"""Count verified heldout-v2 sources with the v0 tokenizers and stripping rules.""" +import csv, hashlib, importlib.util, json, statistics +from pathlib import Path + +import tiktoken +import tiktoken.load + +ROOT = Path(__file__).resolve().parent +_spec = importlib.util.spec_from_file_location("v0count", ROOT.parent / "token-efficiency-v0/count_tokens.py") +v0 = importlib.util.module_from_spec(_spec) +_spec.loader.exec_module(v0) # reuse strip_comments and offline guard unchanged +LANGUAGES = v0.LANGUAGES + + +def main(): + if tiktoken.__version__ != "0.8.0": + raise RuntimeError("Install requirements.txt: tiktoken==0.8.0 required") + tiktoken.load.read_file = v0.offline_read + encodings = {n: tiktoken.get_encoding(n) for n in ("cl100k_base", "o200k_base")} + tasks = json.loads((ROOT / "tasks/manifest.json").read_text())["tasks"] + cats = {t["id"]: t["category"] for t in tasks} + gaps = {(g["task"], g["lang"]) for g in json.loads((ROOT / "gaps.json").read_text())} + checks = {(r["task"], r["lang"]): r for r in json.loads((ROOT / "results/verification.json").read_text())} + expected = {(t["id"], l) for t in tasks for l in LANGUAGES} - gaps + if set(checks) != expected: + raise RuntimeError("verification coverage must be every task x language minus gaps.json") + rows = [] + for t in tasks: + for lang, ext in LANGUAGES.items(): + if (t["id"], lang) in gaps: + continue + raw = (ROOT / f"solutions/{lang}/{t['id']}.{ext}").read_bytes() + c = checks[t["id"], lang] + if hashlib.sha256(raw).hexdigest() != c["sha256"] or not c["pass"]: + raise RuntimeError(f"unverified or changed source {t['id']}/{lang}") + src = raw.decode() + stripped = v0.strip_comments(src, lang) + for name, enc in encodings.items(): + rows.append({"task": t["id"], "category": t["category"], "lang": lang, "encoding": name, + "tokens": len(enc.encode(src, disallowed_special=())), + "tokens_nocomments": len(enc.encode(stripped, disallowed_special=())), + "bytes": len(raw), "pass": c["pass"]}) + (ROOT / "results/tokens.json").write_text(json.dumps(rows, indent=2) + "\n") + with (ROOT / "results/tokens.csv").open("w", newline="") as f: + w = csv.DictWriter(f, fieldnames=list(rows[0])) + w.writeheader() + w.writerows(rows) + summary = {} + for enc in encodings: + summary[enc] = {} + for metric in ("tokens", "tokens_nocomments"): + by = {l: {r["task"]: r[metric] for r in rows if r["encoding"] == enc and r["lang"] == l} for l in LANGUAGES} + solved = sorted(by["howl"]) + s = {"languages": {l: {"median_all": statistics.median(v.values()), + "median_howl_solved": statistics.median(v[t] for t in solved), + "mean_howl_solved": statistics.mean(v[t] for t in solved)} for l, v in by.items()}, + "howl_vs": {}, "categories": {}} + for l in ("python", "js", "go"): + ratios = [by["howl"][t] / by[l][t] for t in solved] + s["howl_vs"][l] = { + "median_per_task_ratio": statistics.median(ratios), + "ratio_of_medians": statistics.median(by["howl"].values()) / statistics.median(by[l][t] for t in solved), + "wins": sum(by["howl"][t] < by[l][t] for t in solved), + "ties": sum(by["howl"][t] == by[l][t] for t in solved), + "losses": sum(by["howl"][t] > by[l][t] for t in solved), + "gaps": len(by[l]) - len(solved), + } + for cat in sorted(set(cats.values())): + ids = [t for t in by["python"] if cats[t] == cat] + hs = [t for t in ids if t in by["howl"]] + s["categories"][cat] = { + "n": len(ids), "howl_solved": len(hs), + **{f"mean_{l}": (statistics.mean(by[l][t] for t in hs) if hs else None) for l in LANGUAGES}, + "median_ratio_vs_python": statistics.median(by["howl"][t] / by["python"][t] for t in hs) if hs else None, + } + summary[enc][metric] = s + (ROOT / "results/summary.json").write_text(json.dumps(summary, indent=2) + "\n") + print(json.dumps({e: summary[e]["tokens"]["howl_vs"] for e in summary}, indent=1)) + + +if __name__ == "__main__": + main() diff --git a/experiments/token-efficiency-heldout-v2/gaps.json b/experiments/token-efficiency-heldout-v2/gaps.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/gaps.json @@ -0,0 +1 @@ +[] diff --git a/experiments/token-efficiency-heldout-v2/requirements.txt b/experiments/token-efficiency-heldout-v2/requirements.txt new file mode 100644 index 0000000..135d4f5 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/requirements.txt @@ -0,0 +1 @@ +tiktoken==0.8.0 diff --git a/experiments/token-efficiency-heldout-v2/results/summary.json b/experiments/token-efficiency-heldout-v2/results/summary.json new file mode 100644 index 0000000..b7f2dc8 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/results/summary.json @@ -0,0 +1,466 @@ +{ + "cl100k_base": { + "tokens": { + "languages": { + "howl": { + "median_all": 101, + "median_howl_solved": 101, + "mean_howl_solved": 110.37837837837837 + }, + "python": { + "median_all": 78, + "median_howl_solved": 78, + "mean_howl_solved": 83.35135135135135 + }, + "js": { + "median_all": 91, + "median_howl_solved": 91, + "mean_howl_solved": 94.5945945945946 + }, + "go": { + "median_all": 181, + "median_howl_solved": 181, + "mean_howl_solved": 188.43243243243242 + } + }, + "howl_vs": { + "python": { + "median_per_task_ratio": 1.3055555555555556, + "ratio_of_medians": 1.294871794871795, + "wins": 2, + "ties": 0, + "losses": 35, + "gaps": 0 + }, + "js": { + "median_per_task_ratio": 1.1358024691358024, + "ratio_of_medians": 1.10989010989011, + "wins": 7, + "ties": 2, + "losses": 28, + "gaps": 0 + }, + "go": { + "median_per_task_ratio": 0.5897435897435898, + "ratio_of_medians": 0.5580110497237569, + "wins": 37, + "ties": 0, + "losses": 0, + "gaps": 0 + } + }, + "categories": { + "lists": { + "n": 4, + "howl_solved": 4, + "mean_howl": 94.25, + "mean_python": 67.75, + "mean_js": 79, + "mean_go": 190.25, + "median_ratio_vs_python": 1.4226475279106858 + }, + "logic": { + "n": 13, + "howl_solved": 13, + "mean_howl": 138.07692307692307, + "mean_python": 107, + "mean_js": 116.6923076923077, + "mean_go": 212.30769230769232, + "median_ratio_vs_python": 1.24375 + }, + "numbers": { + "n": 4, + "howl_solved": 4, + "mean_howl": 103.25, + "mean_python": 70.25, + "mean_js": 98.25, + "mean_go": 185.5, + "median_ratio_vs_python": 1.4326388888888888 + }, + "records": { + "n": 4, + "howl_solved": 4, + "mean_howl": 95, + "mean_python": 76.5, + "mean_js": 84.25, + "mean_go": 197, + "median_ratio_vs_python": 1.1902564102564102 + }, + "strings": { + "n": 4, + "howl_solved": 4, + "mean_howl": 81.25, + "mean_python": 61.5, + "mean_js": 65, + "mean_go": 143.75, + "median_ratio_vs_python": 1.343630816170862 + }, + "table": { + "n": 4, + "howl_solved": 4, + "mean_howl": 108.5, + "mean_python": 78.75, + "mean_js": 91.5, + "mean_go": 184.75, + "median_ratio_vs_python": 1.2788831835686778 + }, + "text": { + "n": 4, + "howl_solved": 4, + "mean_howl": 90, + "mean_python": 68.5, + "mean_js": 77.75, + "mean_go": 151.75, + "median_ratio_vs_python": 1.2537020517395183 + } + } + }, + "tokens_nocomments": { + "languages": { + "howl": { + "median_all": 101, + "median_howl_solved": 101, + "mean_howl_solved": 110.37837837837837 + }, + "python": { + "median_all": 78, + "median_howl_solved": 78, + "mean_howl_solved": 83.35135135135135 + }, + "js": { + "median_all": 91, + "median_howl_solved": 91, + "mean_howl_solved": 94.5945945945946 + }, + "go": { + "median_all": 175, + "median_howl_solved": 175, + "mean_howl_solved": 182.43243243243242 + } + }, + "howl_vs": { + "python": { + "median_per_task_ratio": 1.3055555555555556, + "ratio_of_medians": 1.294871794871795, + "wins": 2, + "ties": 0, + "losses": 35, + "gaps": 0 + }, + "js": { + "median_per_task_ratio": 1.1358024691358024, + "ratio_of_medians": 1.10989010989011, + "wins": 7, + "ties": 2, + "losses": 28, + "gaps": 0 + }, + "go": { + "median_per_task_ratio": 0.6133333333333333, + "ratio_of_medians": 0.5771428571428572, + "wins": 37, + "ties": 0, + "losses": 0, + "gaps": 0 + } + }, + "categories": { + "lists": { + "n": 4, + "howl_solved": 4, + "mean_howl": 94.25, + "mean_python": 67.75, + "mean_js": 79, + "mean_go": 184.25, + "median_ratio_vs_python": 1.4226475279106858 + }, + "logic": { + "n": 13, + "howl_solved": 13, + "mean_howl": 138.07692307692307, + "mean_python": 107, + "mean_js": 116.6923076923077, + "mean_go": 206.30769230769232, + "median_ratio_vs_python": 1.24375 + }, + "numbers": { + "n": 4, + "howl_solved": 4, + "mean_howl": 103.25, + "mean_python": 70.25, + "mean_js": 98.25, + "mean_go": 179.5, + "median_ratio_vs_python": 1.4326388888888888 + }, + "records": { + "n": 4, + "howl_solved": 4, + "mean_howl": 95, + "mean_python": 76.5, + "mean_js": 84.25, + "mean_go": 191, + "median_ratio_vs_python": 1.1902564102564102 + }, + "strings": { + "n": 4, + "howl_solved": 4, + "mean_howl": 81.25, + "mean_python": 61.5, + "mean_js": 65, + "mean_go": 137.75, + "median_ratio_vs_python": 1.343630816170862 + }, + "table": { + "n": 4, + "howl_solved": 4, + "mean_howl": 108.5, + "mean_python": 78.75, + "mean_js": 91.5, + "mean_go": 178.75, + "median_ratio_vs_python": 1.2788831835686778 + }, + "text": { + "n": 4, + "howl_solved": 4, + "mean_howl": 90, + "mean_python": 68.5, + "mean_js": 77.75, + "mean_go": 145.75, + "median_ratio_vs_python": 1.2537020517395183 + } + } + } + }, + "o200k_base": { + "tokens": { + "languages": { + "howl": { + "median_all": 101, + "median_howl_solved": 101, + "mean_howl_solved": 110.67567567567568 + }, + "python": { + "median_all": 78, + "median_howl_solved": 78, + "mean_howl_solved": 83.78378378378379 + }, + "js": { + "median_all": 96, + "median_howl_solved": 96, + "mean_howl_solved": 99.54054054054055 + }, + "go": { + "median_all": 182, + "median_howl_solved": 182, + "mean_howl_solved": 190 + } + }, + "howl_vs": { + "python": { + "median_per_task_ratio": 1.3055555555555556, + "ratio_of_medians": 1.294871794871795, + "wins": 2, + "ties": 0, + "losses": 35, + "gaps": 0 + }, + "js": { + "median_per_task_ratio": 1.0833333333333333, + "ratio_of_medians": 1.0520833333333333, + "wins": 10, + "ties": 1, + "losses": 26, + "gaps": 0 + }, + "go": { + "median_per_task_ratio": 0.5822784810126582, + "ratio_of_medians": 0.554945054945055, + "wins": 37, + "ties": 0, + "losses": 0, + "gaps": 0 + } + }, + "categories": { + "lists": { + "n": 4, + "howl_solved": 4, + "mean_howl": 94.25, + "mean_python": 68.25, + "mean_js": 84, + "mean_go": 191.5, + "median_ratio_vs_python": 1.40282131661442 + }, + "logic": { + "n": 13, + "howl_solved": 13, + "mean_howl": 138.69230769230768, + "mean_python": 107.53846153846153, + "mean_js": 122.07692307692308, + "mean_go": 214.53846153846155, + "median_ratio_vs_python": 1.2422360248447204 + }, + "numbers": { + "n": 4, + "howl_solved": 4, + "mean_howl": 103.25, + "mean_python": 70.25, + "mean_js": 102.25, + "mean_go": 187, + "median_ratio_vs_python": 1.4326388888888888 + }, + "records": { + "n": 4, + "howl_solved": 4, + "mean_howl": 95.5, + "mean_python": 76.5, + "mean_js": 89.25, + "mean_go": 197.75, + "median_ratio_vs_python": 1.1966666666666668 + }, + "strings": { + "n": 4, + "howl_solved": 4, + "mean_howl": 81.5, + "mean_python": 61.5, + "mean_js": 70.5, + "mean_go": 145, + "median_ratio_vs_python": 1.3508771929824561 + }, + "table": { + "n": 4, + "howl_solved": 4, + "mean_howl": 108.5, + "mean_python": 80.5, + "mean_js": 95.75, + "mean_go": 185.75, + "median_ratio_vs_python": 1.2472527472527473 + }, + "text": { + "n": 4, + "howl_solved": 4, + "mean_howl": 90, + "mean_python": 68.5, + "mean_js": 82.25, + "mean_go": 153.25, + "median_ratio_vs_python": 1.2537020517395183 + } + } + }, + "tokens_nocomments": { + "languages": { + "howl": { + "median_all": 101, + "median_howl_solved": 101, + "mean_howl_solved": 110.67567567567568 + }, + "python": { + "median_all": 78, + "median_howl_solved": 78, + "mean_howl_solved": 83.78378378378379 + }, + "js": { + "median_all": 96, + "median_howl_solved": 96, + "mean_howl_solved": 99.54054054054055 + }, + "go": { + "median_all": 176, + "median_howl_solved": 176, + "mean_howl_solved": 184 + } + }, + "howl_vs": { + "python": { + "median_per_task_ratio": 1.3055555555555556, + "ratio_of_medians": 1.294871794871795, + "wins": 2, + "ties": 0, + "losses": 35, + "gaps": 0 + }, + "js": { + "median_per_task_ratio": 1.0833333333333333, + "ratio_of_medians": 1.0520833333333333, + "wins": 10, + "ties": 1, + "losses": 26, + "gaps": 0 + }, + "go": { + "median_per_task_ratio": 0.6052631578947368, + "ratio_of_medians": 0.5738636363636364, + "wins": 37, + "ties": 0, + "losses": 0, + "gaps": 0 + } + }, + "categories": { + "lists": { + "n": 4, + "howl_solved": 4, + "mean_howl": 94.25, + "mean_python": 68.25, + "mean_js": 84, + "mean_go": 185.5, + "median_ratio_vs_python": 1.40282131661442 + }, + "logic": { + "n": 13, + "howl_solved": 13, + "mean_howl": 138.69230769230768, + "mean_python": 107.53846153846153, + "mean_js": 122.07692307692308, + "mean_go": 208.53846153846155, + "median_ratio_vs_python": 1.2422360248447204 + }, + "numbers": { + "n": 4, + "howl_solved": 4, + "mean_howl": 103.25, + "mean_python": 70.25, + "mean_js": 102.25, + "mean_go": 181, + "median_ratio_vs_python": 1.4326388888888888 + }, + "records": { + "n": 4, + "howl_solved": 4, + "mean_howl": 95.5, + "mean_python": 76.5, + "mean_js": 89.25, + "mean_go": 191.75, + "median_ratio_vs_python": 1.1966666666666668 + }, + "strings": { + "n": 4, + "howl_solved": 4, + "mean_howl": 81.5, + "mean_python": 61.5, + "mean_js": 70.5, + "mean_go": 139, + "median_ratio_vs_python": 1.3508771929824561 + }, + "table": { + "n": 4, + "howl_solved": 4, + "mean_howl": 108.5, + "mean_python": 80.5, + "mean_js": 95.75, + "mean_go": 179.75, + "median_ratio_vs_python": 1.2472527472527473 + }, + "text": { + "n": 4, + "howl_solved": 4, + "mean_howl": 90, + "mean_python": 68.5, + "mean_js": 82.25, + "mean_go": 147.25, + "median_ratio_vs_python": 1.2537020517395183 + } + } + } + } +} diff --git a/experiments/token-efficiency-heldout-v2/results/tokens.csv b/experiments/token-efficiency-heldout-v2/results/tokens.csv new file mode 100644 index 0000000..5fd679f --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/results/tokens.csv @@ -0,0 +1,297 @@ +task,category,lang,encoding,tokens,tokens_nocomments,bytes,pass +w01,text,howl,cl100k_base,111,111,318,True +w01,text,howl,o200k_base,111,111,318,True +w01,text,python,cl100k_base,95,95,325,True +w01,text,python,o200k_base,95,95,325,True +w01,text,js,cl100k_base,106,106,350,True +w01,text,js,o200k_base,110,110,350,True +w01,text,go,cl100k_base,168,162,526,True +w01,text,go,o200k_base,170,164,526,True +w02,text,howl,cl100k_base,79,79,227,True +w02,text,howl,o200k_base,79,79,227,True +w02,text,python,cl100k_base,59,59,211,True +w02,text,python,o200k_base,59,59,211,True +w02,text,js,cl100k_base,61,61,210,True +w02,text,js,o200k_base,65,65,210,True +w02,text,go,cl100k_base,133,127,429,True +w02,text,go,o200k_base,134,128,429,True +w03,text,howl,cl100k_base,104,104,301,True +w03,text,howl,o200k_base,104,104,301,True +w03,text,python,cl100k_base,57,57,211,True +w03,text,python,o200k_base,57,57,211,True +w03,text,js,cl100k_base,64,64,234,True +w03,text,js,o200k_base,68,68,234,True +w03,text,go,cl100k_base,143,137,476,True +w03,text,go,o200k_base,144,138,476,True +w04,text,howl,cl100k_base,66,66,199,True +w04,text,howl,o200k_base,66,66,199,True +w04,text,python,cl100k_base,63,63,210,True +w04,text,python,o200k_base,63,63,210,True +w04,text,js,cl100k_base,80,80,273,True +w04,text,js,o200k_base,86,86,273,True +w04,text,go,cl100k_base,163,157,525,True +w04,text,go,o200k_base,165,159,525,True +w05,table,howl,cl100k_base,98,98,271,True +w05,table,howl,o200k_base,98,98,271,True +w05,table,python,cl100k_base,76,76,273,True +w05,table,python,o200k_base,78,78,273,True +w05,table,js,cl100k_base,88,88,305,True +w05,table,js,o200k_base,92,92,305,True +w05,table,go,cl100k_base,177,171,577,True +w05,table,go,o200k_base,178,172,577,True +w06,table,howl,cl100k_base,97,97,265,True +w06,table,howl,o200k_base,97,97,265,True +w06,table,python,cl100k_base,79,79,272,True +w06,table,python,o200k_base,82,82,272,True +w06,table,js,cl100k_base,101,101,332,True +w06,table,js,o200k_base,105,105,332,True +w06,table,go,cl100k_base,179,173,581,True +w06,table,go,o200k_base,180,174,581,True +w07,table,howl,cl100k_base,104,104,292,True +w07,table,howl,o200k_base,104,104,292,True +w07,table,python,cl100k_base,82,82,271,True +w07,table,python,o200k_base,84,84,271,True +w07,table,js,cl100k_base,91,91,321,True +w07,table,js,o200k_base,96,96,321,True +w07,table,go,cl100k_base,202,196,636,True +w07,table,go,o200k_base,203,197,636,True +w08,table,howl,cl100k_base,135,135,376,True +w08,table,howl,o200k_base,135,135,376,True +w08,table,python,cl100k_base,78,78,262,True +w08,table,python,o200k_base,78,78,262,True +w08,table,js,cl100k_base,86,86,311,True +w08,table,js,o200k_base,90,90,311,True +w08,table,go,cl100k_base,181,175,575,True +w08,table,go,o200k_base,182,176,575,True +w09,numbers,howl,cl100k_base,56,56,166,True +w09,numbers,howl,o200k_base,56,56,166,True +w09,numbers,python,cl100k_base,50,50,173,True +w09,numbers,python,o200k_base,50,50,173,True +w09,numbers,js,cl100k_base,61,61,213,True +w09,numbers,js,o200k_base,65,65,213,True +w09,numbers,go,cl100k_base,150,144,497,True +w09,numbers,go,o200k_base,151,145,497,True +w10,numbers,howl,cl100k_base,117,117,291,True +w10,numbers,howl,o200k_base,117,117,291,True +w10,numbers,python,cl100k_base,80,80,229,True +w10,numbers,python,o200k_base,80,80,229,True +w10,numbers,js,cl100k_base,108,108,326,True +w10,numbers,js,o200k_base,112,112,326,True +w10,numbers,go,cl100k_base,166,160,510,True +w10,numbers,go,o200k_base,167,161,510,True +w11,numbers,howl,cl100k_base,139,139,361,True +w11,numbers,howl,o200k_base,139,139,361,True +w11,numbers,python,cl100k_base,79,79,264,True +w11,numbers,python,o200k_base,79,79,264,True +w11,numbers,js,cl100k_base,127,127,383,True +w11,numbers,js,o200k_base,131,131,383,True +w11,numbers,go,cl100k_base,220,214,696,True +w11,numbers,go,o200k_base,222,216,696,True +w12,numbers,howl,cl100k_base,101,101,280,True +w12,numbers,howl,o200k_base,101,101,280,True +w12,numbers,python,cl100k_base,72,72,226,True +w12,numbers,python,o200k_base,72,72,226,True +w12,numbers,js,cl100k_base,97,97,293,True +w12,numbers,js,o200k_base,101,101,293,True +w12,numbers,go,cl100k_base,206,200,628,True +w12,numbers,go,o200k_base,208,202,628,True +w13,lists,howl,cl100k_base,79,79,227,True +w13,lists,howl,o200k_base,78,78,227,True +w13,lists,python,cl100k_base,62,62,203,True +w13,lists,python,o200k_base,61,61,203,True +w13,lists,js,cl100k_base,78,78,256,True +w13,lists,js,o200k_base,81,81,256,True +w13,lists,go,cl100k_base,171,165,536,True +w13,lists,go,o200k_base,171,165,536,True +w14,lists,howl,cl100k_base,123,123,377,True +w14,lists,howl,o200k_base,124,124,377,True +w14,lists,python,cl100k_base,86,86,308,True +w14,lists,python,o200k_base,88,88,308,True +w14,lists,js,cl100k_base,105,105,374,True +w14,lists,js,o200k_base,112,112,374,True +w14,lists,go,cl100k_base,221,215,714,True +w14,lists,go,o200k_base,223,217,714,True +w15,lists,howl,cl100k_base,94,94,276,True +w15,lists,howl,o200k_base,94,94,276,True +w15,lists,python,cl100k_base,66,66,225,True +w15,lists,python,o200k_base,66,66,225,True +w15,lists,js,cl100k_base,74,74,272,True +w15,lists,js,o200k_base,80,80,272,True +w15,lists,go,cl100k_base,205,199,682,True +w15,lists,go,o200k_base,207,201,682,True +w16,lists,howl,cl100k_base,81,81,235,True +w16,lists,howl,o200k_base,81,81,235,True +w16,lists,python,cl100k_base,57,57,187,True +w16,lists,python,o200k_base,58,58,187,True +w16,lists,js,cl100k_base,59,59,196,True +w16,lists,js,o200k_base,63,63,196,True +w16,lists,go,cl100k_base,164,158,501,True +w16,lists,go,o200k_base,165,159,501,True +w17,strings,howl,cl100k_base,92,92,255,True +w17,strings,howl,o200k_base,92,92,255,True +w17,strings,python,cl100k_base,57,57,198,True +w17,strings,python,o200k_base,57,57,198,True +w17,strings,js,cl100k_base,62,62,206,True +w17,strings,js,o200k_base,66,66,206,True +w17,strings,go,cl100k_base,156,150,465,True +w17,strings,go,o200k_base,158,152,465,True +w18,strings,howl,cl100k_base,64,64,194,True +w18,strings,howl,o200k_base,64,64,194,True +w18,strings,python,cl100k_base,63,63,212,True +w18,strings,python,o200k_base,63,63,212,True +w18,strings,js,cl100k_base,64,64,224,True +w18,strings,js,o200k_base,70,70,224,True +w18,strings,go,cl100k_base,165,159,538,True +w18,strings,go,o200k_base,165,159,538,True +w19,strings,howl,cl100k_base,91,91,276,True +w19,strings,howl,o200k_base,92,92,276,True +w19,strings,python,cl100k_base,69,69,194,True +w19,strings,python,o200k_base,69,69,194,True +w19,strings,js,cl100k_base,73,73,236,True +w19,strings,js,o200k_base,81,81,236,True +w19,strings,go,cl100k_base,129,123,397,True +w19,strings,go,o200k_base,131,125,397,True +w20,strings,howl,cl100k_base,78,78,226,True +w20,strings,howl,o200k_base,78,78,226,True +w20,strings,python,cl100k_base,57,57,184,True +w20,strings,python,o200k_base,57,57,184,True +w20,strings,js,cl100k_base,61,61,215,True +w20,strings,js,o200k_base,65,65,215,True +w20,strings,go,cl100k_base,125,119,416,True +w20,strings,go,o200k_base,126,120,416,True +w21,records,howl,cl100k_base,99,99,295,True +w21,records,howl,o200k_base,99,99,295,True +w21,records,python,cl100k_base,65,65,252,True +w21,records,python,o200k_base,65,65,252,True +w21,records,js,cl100k_base,69,69,246,True +w21,records,js,o200k_base,73,73,246,True +w21,records,go,cl100k_base,174,168,591,True +w21,records,go,o200k_base,175,169,591,True +w22,records,howl,cl100k_base,99,99,308,True +w22,records,howl,o200k_base,100,100,308,True +w22,records,python,cl100k_base,88,88,306,True +w22,records,python,o200k_base,88,88,306,True +w22,records,js,cl100k_base,104,104,358,True +w22,records,js,o200k_base,110,110,358,True +w22,records,go,cl100k_base,226,220,748,True +w22,records,go,o200k_base,228,222,748,True +w23,records,howl,cl100k_base,90,90,273,True +w23,records,howl,o200k_base,91,91,273,True +w23,records,python,cl100k_base,78,78,277,True +w23,records,python,o200k_base,78,78,277,True +w23,records,js,cl100k_base,83,83,287,True +w23,records,js,o200k_base,89,89,287,True +w23,records,go,cl100k_base,198,192,638,True +w23,records,go,o200k_base,198,192,638,True +w24,records,howl,cl100k_base,92,92,270,True +w24,records,howl,o200k_base,92,92,270,True +w24,records,python,cl100k_base,75,75,271,True +w24,records,python,o200k_base,75,75,271,True +w24,records,js,cl100k_base,81,81,276,True +w24,records,js,o200k_base,85,85,276,True +w24,records,go,cl100k_base,190,184,603,True +w24,records,go,o200k_base,190,184,603,True +w25,logic,howl,cl100k_base,128,128,354,True +w25,logic,howl,o200k_base,128,128,354,True +w25,logic,python,cl100k_base,77,77,220,True +w25,logic,python,o200k_base,77,77,220,True +w25,logic,js,cl100k_base,102,102,311,True +w25,logic,js,o200k_base,106,106,311,True +w25,logic,go,cl100k_base,188,182,569,True +w25,logic,go,o200k_base,190,184,569,True +w26,logic,howl,cl100k_base,94,94,227,True +w26,logic,howl,o200k_base,94,94,227,True +w26,logic,python,cl100k_base,72,72,195,True +w26,logic,python,o200k_base,72,72,195,True +w26,logic,js,cl100k_base,76,76,215,True +w26,logic,js,o200k_base,80,80,215,True +w26,logic,go,cl100k_base,157,151,458,True +w26,logic,go,o200k_base,160,154,458,True +w27,logic,howl,cl100k_base,91,91,247,True +w27,logic,howl,o200k_base,92,92,247,True +w27,logic,python,cl100k_base,95,95,279,True +w27,logic,python,o200k_base,95,95,279,True +w27,logic,js,cl100k_base,98,98,282,True +w27,logic,js,o200k_base,102,102,282,True +w27,logic,go,cl100k_base,184,178,548,True +w27,logic,go,o200k_base,185,179,548,True +w28,logic,howl,cl100k_base,146,146,440,True +w28,logic,howl,o200k_base,147,147,440,True +w28,logic,python,cl100k_base,133,133,462,True +w28,logic,python,o200k_base,134,134,462,True +w28,logic,js,cl100k_base,155,155,518,True +w28,logic,js,o200k_base,162,162,518,True +w28,logic,go,cl100k_base,229,223,712,True +w28,logic,go,o200k_base,231,225,712,True +w29,logic,howl,cl100k_base,108,108,321,True +w29,logic,howl,o200k_base,108,108,321,True +w29,logic,python,cl100k_base,90,90,319,True +w29,logic,python,o200k_base,90,90,319,True +w29,logic,js,cl100k_base,118,118,403,True +w29,logic,js,o200k_base,124,124,403,True +w29,logic,go,cl100k_base,214,208,696,True +w29,logic,go,o200k_base,217,211,696,True +w30,logic,howl,cl100k_base,163,163,413,True +w30,logic,howl,o200k_base,163,163,413,True +w30,logic,python,cl100k_base,140,140,379,True +w30,logic,python,o200k_base,140,140,379,True +w30,logic,js,cl100k_base,147,147,378,True +w30,logic,js,o200k_base,151,151,378,True +w30,logic,go,cl100k_base,254,248,715,True +w30,logic,go,o200k_base,255,249,715,True +w31,logic,howl,cl100k_base,104,104,277,True +w31,logic,howl,o200k_base,104,104,277,True +w31,logic,python,cl100k_base,49,49,166,True +w31,logic,python,o200k_base,49,49,166,True +w31,logic,js,cl100k_base,54,54,188,True +w31,logic,js,o200k_base,59,59,188,True +w31,logic,go,cl100k_base,151,145,483,True +w31,logic,go,o200k_base,152,146,483,True +w32,logic,howl,cl100k_base,142,142,372,True +w32,logic,howl,o200k_base,143,143,372,True +w32,logic,python,cl100k_base,124,124,375,True +w32,logic,python,o200k_base,126,126,375,True +w32,logic,js,cl100k_base,142,142,404,True +w32,logic,js,o200k_base,147,147,404,True +w32,logic,go,cl100k_base,232,226,674,True +w32,logic,go,o200k_base,237,231,674,True +w33,logic,howl,cl100k_base,143,143,419,True +w33,logic,howl,o200k_base,145,145,419,True +w33,logic,python,cl100k_base,95,95,326,True +w33,logic,python,o200k_base,96,96,326,True +w33,logic,js,cl100k_base,113,113,371,True +w33,logic,js,o200k_base,120,120,371,True +w33,logic,go,cl100k_base,252,246,781,True +w33,logic,go,o200k_base,255,249,781,True +w34,logic,howl,cl100k_base,227,227,549,True +w34,logic,howl,o200k_base,227,227,549,True +w34,logic,python,cl100k_base,145,145,378,True +w34,logic,python,o200k_base,145,145,378,True +w34,logic,js,cl100k_base,123,123,359,True +w34,logic,js,o200k_base,130,130,359,True +w34,logic,go,cl100k_base,250,244,642,True +w34,logic,go,o200k_base,251,245,642,True +w35,logic,howl,cl100k_base,140,140,396,True +w35,logic,howl,o200k_base,141,141,396,True +w35,logic,python,cl100k_base,100,100,336,True +w35,logic,python,o200k_base,101,101,336,True +w35,logic,js,cl100k_base,123,123,420,True +w35,logic,js,o200k_base,130,130,420,True +w35,logic,go,cl100k_base,230,224,742,True +w35,logic,go,o200k_base,234,228,742,True +w36,logic,howl,cl100k_base,110,110,344,True +w36,logic,howl,o200k_base,111,111,344,True +w36,logic,python,cl100k_base,111,111,375,True +w36,logic,python,o200k_base,112,112,375,True +w36,logic,js,cl100k_base,98,98,292,True +w36,logic,js,o200k_base,102,102,292,True +w36,logic,go,cl100k_base,179,173,624,True +w36,logic,go,o200k_base,180,174,624,True +w37,logic,howl,cl100k_base,199,199,468,True +w37,logic,howl,o200k_base,200,200,468,True +w37,logic,python,cl100k_base,160,160,358,True +w37,logic,python,o200k_base,161,161,358,True +w37,logic,js,cl100k_base,168,168,386,True +w37,logic,js,o200k_base,174,174,386,True +w37,logic,go,cl100k_base,240,234,591,True +w37,logic,go,o200k_base,242,236,591,True diff --git a/experiments/token-efficiency-heldout-v2/results/tokens.json b/experiments/token-efficiency-heldout-v2/results/tokens.json new file mode 100644 index 0000000..51db25d --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/results/tokens.json @@ -0,0 +1,2962 @@ +[ + { + "task": "w01", + "category": "text", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 111, + "tokens_nocomments": 111, + "bytes": 318, + "pass": true + }, + { + "task": "w01", + "category": "text", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 111, + "tokens_nocomments": 111, + "bytes": 318, + "pass": true + }, + { + "task": "w01", + "category": "text", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 95, + "tokens_nocomments": 95, + "bytes": 325, + "pass": true + }, + { + "task": "w01", + "category": "text", + "lang": "python", + "encoding": "o200k_base", + "tokens": 95, + "tokens_nocomments": 95, + "bytes": 325, + "pass": true + }, + { + "task": "w01", + "category": "text", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 106, + "tokens_nocomments": 106, + "bytes": 350, + "pass": true + }, + { + "task": "w01", + "category": "text", + "lang": "js", + "encoding": "o200k_base", + "tokens": 110, + "tokens_nocomments": 110, + "bytes": 350, + "pass": true + }, + { + "task": "w01", + "category": "text", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 168, + "tokens_nocomments": 162, + "bytes": 526, + "pass": true + }, + { + "task": "w01", + "category": "text", + "lang": "go", + "encoding": "o200k_base", + "tokens": 170, + "tokens_nocomments": 164, + "bytes": 526, + "pass": true + }, + { + "task": "w02", + "category": "text", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 79, + "tokens_nocomments": 79, + "bytes": 227, + "pass": true + }, + { + "task": "w02", + "category": "text", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 79, + "tokens_nocomments": 79, + "bytes": 227, + "pass": true + }, + { + "task": "w02", + "category": "text", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 59, + "tokens_nocomments": 59, + "bytes": 211, + "pass": true + }, + { + "task": "w02", + "category": "text", + "lang": "python", + "encoding": "o200k_base", + "tokens": 59, + "tokens_nocomments": 59, + "bytes": 211, + "pass": true + }, + { + "task": "w02", + "category": "text", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 61, + "tokens_nocomments": 61, + "bytes": 210, + "pass": true + }, + { + "task": "w02", + "category": "text", + "lang": "js", + "encoding": "o200k_base", + "tokens": 65, + "tokens_nocomments": 65, + "bytes": 210, + "pass": true + }, + { + "task": "w02", + "category": "text", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 133, + "tokens_nocomments": 127, + "bytes": 429, + "pass": true + }, + { + "task": "w02", + "category": "text", + "lang": "go", + "encoding": "o200k_base", + "tokens": 134, + "tokens_nocomments": 128, + "bytes": 429, + "pass": true + }, + { + "task": "w03", + "category": "text", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 104, + "tokens_nocomments": 104, + "bytes": 301, + "pass": true + }, + { + "task": "w03", + "category": "text", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 104, + "tokens_nocomments": 104, + "bytes": 301, + "pass": true + }, + { + "task": "w03", + "category": "text", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 57, + "tokens_nocomments": 57, + "bytes": 211, + "pass": true + }, + { + "task": "w03", + "category": "text", + "lang": "python", + "encoding": "o200k_base", + "tokens": 57, + "tokens_nocomments": 57, + "bytes": 211, + "pass": true + }, + { + "task": "w03", + "category": "text", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 64, + "tokens_nocomments": 64, + "bytes": 234, + "pass": true + }, + { + "task": "w03", + "category": "text", + "lang": "js", + "encoding": "o200k_base", + "tokens": 68, + "tokens_nocomments": 68, + "bytes": 234, + "pass": true + }, + { + "task": "w03", + "category": "text", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 143, + "tokens_nocomments": 137, + "bytes": 476, + "pass": true + }, + { + "task": "w03", + "category": "text", + "lang": "go", + "encoding": "o200k_base", + "tokens": 144, + "tokens_nocomments": 138, + "bytes": 476, + "pass": true + }, + { + "task": "w04", + "category": "text", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 66, + "tokens_nocomments": 66, + "bytes": 199, + "pass": true + }, + { + "task": "w04", + "category": "text", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 66, + "tokens_nocomments": 66, + "bytes": 199, + "pass": true + }, + { + "task": "w04", + "category": "text", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 63, + "tokens_nocomments": 63, + "bytes": 210, + "pass": true + }, + { + "task": "w04", + "category": "text", + "lang": "python", + "encoding": "o200k_base", + "tokens": 63, + "tokens_nocomments": 63, + "bytes": 210, + "pass": true + }, + { + "task": "w04", + "category": "text", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 80, + "tokens_nocomments": 80, + "bytes": 273, + "pass": true + }, + { + "task": "w04", + "category": "text", + "lang": "js", + "encoding": "o200k_base", + "tokens": 86, + "tokens_nocomments": 86, + "bytes": 273, + "pass": true + }, + { + "task": "w04", + "category": "text", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 163, + "tokens_nocomments": 157, + "bytes": 525, + "pass": true + }, + { + "task": "w04", + "category": "text", + "lang": "go", + "encoding": "o200k_base", + "tokens": 165, + "tokens_nocomments": 159, + "bytes": 525, + "pass": true + }, + { + "task": "w05", + "category": "table", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 98, + "tokens_nocomments": 98, + "bytes": 271, + "pass": true + }, + { + "task": "w05", + "category": "table", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 98, + "tokens_nocomments": 98, + "bytes": 271, + "pass": true + }, + { + "task": "w05", + "category": "table", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 76, + "tokens_nocomments": 76, + "bytes": 273, + "pass": true + }, + { + "task": "w05", + "category": "table", + "lang": "python", + "encoding": "o200k_base", + "tokens": 78, + "tokens_nocomments": 78, + "bytes": 273, + "pass": true + }, + { + "task": "w05", + "category": "table", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 88, + "tokens_nocomments": 88, + "bytes": 305, + "pass": true + }, + { + "task": "w05", + "category": "table", + "lang": "js", + "encoding": "o200k_base", + "tokens": 92, + "tokens_nocomments": 92, + "bytes": 305, + "pass": true + }, + { + "task": "w05", + "category": "table", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 177, + "tokens_nocomments": 171, + "bytes": 577, + "pass": true + }, + { + "task": "w05", + "category": "table", + "lang": "go", + "encoding": "o200k_base", + "tokens": 178, + "tokens_nocomments": 172, + "bytes": 577, + "pass": true + }, + { + "task": "w06", + "category": "table", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 97, + "tokens_nocomments": 97, + "bytes": 265, + "pass": true + }, + { + "task": "w06", + "category": "table", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 97, + "tokens_nocomments": 97, + "bytes": 265, + "pass": true + }, + { + "task": "w06", + "category": "table", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 79, + "tokens_nocomments": 79, + "bytes": 272, + "pass": true + }, + { + "task": "w06", + "category": "table", + "lang": "python", + "encoding": "o200k_base", + "tokens": 82, + "tokens_nocomments": 82, + "bytes": 272, + "pass": true + }, + { + "task": "w06", + "category": "table", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 101, + "tokens_nocomments": 101, + "bytes": 332, + "pass": true + }, + { + "task": "w06", + "category": "table", + "lang": "js", + "encoding": "o200k_base", + "tokens": 105, + "tokens_nocomments": 105, + "bytes": 332, + "pass": true + }, + { + "task": "w06", + "category": "table", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 179, + "tokens_nocomments": 173, + "bytes": 581, + "pass": true + }, + { + "task": "w06", + "category": "table", + "lang": "go", + "encoding": "o200k_base", + "tokens": 180, + "tokens_nocomments": 174, + "bytes": 581, + "pass": true + }, + { + "task": "w07", + "category": "table", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 104, + "tokens_nocomments": 104, + "bytes": 292, + "pass": true + }, + { + "task": "w07", + "category": "table", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 104, + "tokens_nocomments": 104, + "bytes": 292, + "pass": true + }, + { + "task": "w07", + "category": "table", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 82, + "tokens_nocomments": 82, + "bytes": 271, + "pass": true + }, + { + "task": "w07", + "category": "table", + "lang": "python", + "encoding": "o200k_base", + "tokens": 84, + "tokens_nocomments": 84, + "bytes": 271, + "pass": true + }, + { + "task": "w07", + "category": "table", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 91, + "tokens_nocomments": 91, + "bytes": 321, + "pass": true + }, + { + "task": "w07", + "category": "table", + "lang": "js", + "encoding": "o200k_base", + "tokens": 96, + "tokens_nocomments": 96, + "bytes": 321, + "pass": true + }, + { + "task": "w07", + "category": "table", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 202, + "tokens_nocomments": 196, + "bytes": 636, + "pass": true + }, + { + "task": "w07", + "category": "table", + "lang": "go", + "encoding": "o200k_base", + "tokens": 203, + "tokens_nocomments": 197, + "bytes": 636, + "pass": true + }, + { + "task": "w08", + "category": "table", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 135, + "tokens_nocomments": 135, + "bytes": 376, + "pass": true + }, + { + "task": "w08", + "category": "table", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 135, + "tokens_nocomments": 135, + "bytes": 376, + "pass": true + }, + { + "task": "w08", + "category": "table", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 78, + "tokens_nocomments": 78, + "bytes": 262, + "pass": true + }, + { + "task": "w08", + "category": "table", + "lang": "python", + "encoding": "o200k_base", + "tokens": 78, + "tokens_nocomments": 78, + "bytes": 262, + "pass": true + }, + { + "task": "w08", + "category": "table", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 86, + "tokens_nocomments": 86, + "bytes": 311, + "pass": true + }, + { + "task": "w08", + "category": "table", + "lang": "js", + "encoding": "o200k_base", + "tokens": 90, + "tokens_nocomments": 90, + "bytes": 311, + "pass": true + }, + { + "task": "w08", + "category": "table", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 181, + "tokens_nocomments": 175, + "bytes": 575, + "pass": true + }, + { + "task": "w08", + "category": "table", + "lang": "go", + "encoding": "o200k_base", + "tokens": 182, + "tokens_nocomments": 176, + "bytes": 575, + "pass": true + }, + { + "task": "w09", + "category": "numbers", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 56, + "tokens_nocomments": 56, + "bytes": 166, + "pass": true + }, + { + "task": "w09", + "category": "numbers", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 56, + "tokens_nocomments": 56, + "bytes": 166, + "pass": true + }, + { + "task": "w09", + "category": "numbers", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 50, + "tokens_nocomments": 50, + "bytes": 173, + "pass": true + }, + { + "task": "w09", + "category": "numbers", + "lang": "python", + "encoding": "o200k_base", + "tokens": 50, + "tokens_nocomments": 50, + "bytes": 173, + "pass": true + }, + { + "task": "w09", + "category": "numbers", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 61, + "tokens_nocomments": 61, + "bytes": 213, + "pass": true + }, + { + "task": "w09", + "category": "numbers", + "lang": "js", + "encoding": "o200k_base", + "tokens": 65, + "tokens_nocomments": 65, + "bytes": 213, + "pass": true + }, + { + "task": "w09", + "category": "numbers", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 150, + "tokens_nocomments": 144, + "bytes": 497, + "pass": true + }, + { + "task": "w09", + "category": "numbers", + "lang": "go", + "encoding": "o200k_base", + "tokens": 151, + "tokens_nocomments": 145, + "bytes": 497, + "pass": true + }, + { + "task": "w10", + "category": "numbers", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 117, + "tokens_nocomments": 117, + "bytes": 291, + "pass": true + }, + { + "task": "w10", + "category": "numbers", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 117, + "tokens_nocomments": 117, + "bytes": 291, + "pass": true + }, + { + "task": "w10", + "category": "numbers", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 80, + "tokens_nocomments": 80, + "bytes": 229, + "pass": true + }, + { + "task": "w10", + "category": "numbers", + "lang": "python", + "encoding": "o200k_base", + "tokens": 80, + "tokens_nocomments": 80, + "bytes": 229, + "pass": true + }, + { + "task": "w10", + "category": "numbers", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 108, + "tokens_nocomments": 108, + "bytes": 326, + "pass": true + }, + { + "task": "w10", + "category": "numbers", + "lang": "js", + "encoding": "o200k_base", + "tokens": 112, + "tokens_nocomments": 112, + "bytes": 326, + "pass": true + }, + { + "task": "w10", + "category": "numbers", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 166, + "tokens_nocomments": 160, + "bytes": 510, + "pass": true + }, + { + "task": "w10", + "category": "numbers", + "lang": "go", + "encoding": "o200k_base", + "tokens": 167, + "tokens_nocomments": 161, + "bytes": 510, + "pass": true + }, + { + "task": "w11", + "category": "numbers", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 139, + "tokens_nocomments": 139, + "bytes": 361, + "pass": true + }, + { + "task": "w11", + "category": "numbers", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 139, + "tokens_nocomments": 139, + "bytes": 361, + "pass": true + }, + { + "task": "w11", + "category": "numbers", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 79, + "tokens_nocomments": 79, + "bytes": 264, + "pass": true + }, + { + "task": "w11", + "category": "numbers", + "lang": "python", + "encoding": "o200k_base", + "tokens": 79, + "tokens_nocomments": 79, + "bytes": 264, + "pass": true + }, + { + "task": "w11", + "category": "numbers", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 127, + "tokens_nocomments": 127, + "bytes": 383, + "pass": true + }, + { + "task": "w11", + "category": "numbers", + "lang": "js", + "encoding": "o200k_base", + "tokens": 131, + "tokens_nocomments": 131, + "bytes": 383, + "pass": true + }, + { + "task": "w11", + "category": "numbers", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 220, + "tokens_nocomments": 214, + "bytes": 696, + "pass": true + }, + { + "task": "w11", + "category": "numbers", + "lang": "go", + "encoding": "o200k_base", + "tokens": 222, + "tokens_nocomments": 216, + "bytes": 696, + "pass": true + }, + { + "task": "w12", + "category": "numbers", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 101, + "tokens_nocomments": 101, + "bytes": 280, + "pass": true + }, + { + "task": "w12", + "category": "numbers", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 101, + "tokens_nocomments": 101, + "bytes": 280, + "pass": true + }, + { + "task": "w12", + "category": "numbers", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 72, + "tokens_nocomments": 72, + "bytes": 226, + "pass": true + }, + { + "task": "w12", + "category": "numbers", + "lang": "python", + "encoding": "o200k_base", + "tokens": 72, + "tokens_nocomments": 72, + "bytes": 226, + "pass": true + }, + { + "task": "w12", + "category": "numbers", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 97, + "tokens_nocomments": 97, + "bytes": 293, + "pass": true + }, + { + "task": "w12", + "category": "numbers", + "lang": "js", + "encoding": "o200k_base", + "tokens": 101, + "tokens_nocomments": 101, + "bytes": 293, + "pass": true + }, + { + "task": "w12", + "category": "numbers", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 206, + "tokens_nocomments": 200, + "bytes": 628, + "pass": true + }, + { + "task": "w12", + "category": "numbers", + "lang": "go", + "encoding": "o200k_base", + "tokens": 208, + "tokens_nocomments": 202, + "bytes": 628, + "pass": true + }, + { + "task": "w13", + "category": "lists", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 79, + "tokens_nocomments": 79, + "bytes": 227, + "pass": true + }, + { + "task": "w13", + "category": "lists", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 78, + "tokens_nocomments": 78, + "bytes": 227, + "pass": true + }, + { + "task": "w13", + "category": "lists", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 62, + "tokens_nocomments": 62, + "bytes": 203, + "pass": true + }, + { + "task": "w13", + "category": "lists", + "lang": "python", + "encoding": "o200k_base", + "tokens": 61, + "tokens_nocomments": 61, + "bytes": 203, + "pass": true + }, + { + "task": "w13", + "category": "lists", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 78, + "tokens_nocomments": 78, + "bytes": 256, + "pass": true + }, + { + "task": "w13", + "category": "lists", + "lang": "js", + "encoding": "o200k_base", + "tokens": 81, + "tokens_nocomments": 81, + "bytes": 256, + "pass": true + }, + { + "task": "w13", + "category": "lists", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 171, + "tokens_nocomments": 165, + "bytes": 536, + "pass": true + }, + { + "task": "w13", + "category": "lists", + "lang": "go", + "encoding": "o200k_base", + "tokens": 171, + "tokens_nocomments": 165, + "bytes": 536, + "pass": true + }, + { + "task": "w14", + "category": "lists", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 123, + "tokens_nocomments": 123, + "bytes": 377, + "pass": true + }, + { + "task": "w14", + "category": "lists", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 124, + "tokens_nocomments": 124, + "bytes": 377, + "pass": true + }, + { + "task": "w14", + "category": "lists", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 86, + "tokens_nocomments": 86, + "bytes": 308, + "pass": true + }, + { + "task": "w14", + "category": "lists", + "lang": "python", + "encoding": "o200k_base", + "tokens": 88, + "tokens_nocomments": 88, + "bytes": 308, + "pass": true + }, + { + "task": "w14", + "category": "lists", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 105, + "tokens_nocomments": 105, + "bytes": 374, + "pass": true + }, + { + "task": "w14", + "category": "lists", + "lang": "js", + "encoding": "o200k_base", + "tokens": 112, + "tokens_nocomments": 112, + "bytes": 374, + "pass": true + }, + { + "task": "w14", + "category": "lists", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 221, + "tokens_nocomments": 215, + "bytes": 714, + "pass": true + }, + { + "task": "w14", + "category": "lists", + "lang": "go", + "encoding": "o200k_base", + "tokens": 223, + "tokens_nocomments": 217, + "bytes": 714, + "pass": true + }, + { + "task": "w15", + "category": "lists", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 94, + "tokens_nocomments": 94, + "bytes": 276, + "pass": true + }, + { + "task": "w15", + "category": "lists", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 94, + "tokens_nocomments": 94, + "bytes": 276, + "pass": true + }, + { + "task": "w15", + "category": "lists", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 66, + "tokens_nocomments": 66, + "bytes": 225, + "pass": true + }, + { + "task": "w15", + "category": "lists", + "lang": "python", + "encoding": "o200k_base", + "tokens": 66, + "tokens_nocomments": 66, + "bytes": 225, + "pass": true + }, + { + "task": "w15", + "category": "lists", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 74, + "tokens_nocomments": 74, + "bytes": 272, + "pass": true + }, + { + "task": "w15", + "category": "lists", + "lang": "js", + "encoding": "o200k_base", + "tokens": 80, + "tokens_nocomments": 80, + "bytes": 272, + "pass": true + }, + { + "task": "w15", + "category": "lists", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 205, + "tokens_nocomments": 199, + "bytes": 682, + "pass": true + }, + { + "task": "w15", + "category": "lists", + "lang": "go", + "encoding": "o200k_base", + "tokens": 207, + "tokens_nocomments": 201, + "bytes": 682, + "pass": true + }, + { + "task": "w16", + "category": "lists", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 81, + "tokens_nocomments": 81, + "bytes": 235, + "pass": true + }, + { + "task": "w16", + "category": "lists", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 81, + "tokens_nocomments": 81, + "bytes": 235, + "pass": true + }, + { + "task": "w16", + "category": "lists", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 57, + "tokens_nocomments": 57, + "bytes": 187, + "pass": true + }, + { + "task": "w16", + "category": "lists", + "lang": "python", + "encoding": "o200k_base", + "tokens": 58, + "tokens_nocomments": 58, + "bytes": 187, + "pass": true + }, + { + "task": "w16", + "category": "lists", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 59, + "tokens_nocomments": 59, + "bytes": 196, + "pass": true + }, + { + "task": "w16", + "category": "lists", + "lang": "js", + "encoding": "o200k_base", + "tokens": 63, + "tokens_nocomments": 63, + "bytes": 196, + "pass": true + }, + { + "task": "w16", + "category": "lists", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 164, + "tokens_nocomments": 158, + "bytes": 501, + "pass": true + }, + { + "task": "w16", + "category": "lists", + "lang": "go", + "encoding": "o200k_base", + "tokens": 165, + "tokens_nocomments": 159, + "bytes": 501, + "pass": true + }, + { + "task": "w17", + "category": "strings", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 92, + "tokens_nocomments": 92, + "bytes": 255, + "pass": true + }, + { + "task": "w17", + "category": "strings", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 92, + "tokens_nocomments": 92, + "bytes": 255, + "pass": true + }, + { + "task": "w17", + "category": "strings", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 57, + "tokens_nocomments": 57, + "bytes": 198, + "pass": true + }, + { + "task": "w17", + "category": "strings", + "lang": "python", + "encoding": "o200k_base", + "tokens": 57, + "tokens_nocomments": 57, + "bytes": 198, + "pass": true + }, + { + "task": "w17", + "category": "strings", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 62, + "tokens_nocomments": 62, + "bytes": 206, + "pass": true + }, + { + "task": "w17", + "category": "strings", + "lang": "js", + "encoding": "o200k_base", + "tokens": 66, + "tokens_nocomments": 66, + "bytes": 206, + "pass": true + }, + { + "task": "w17", + "category": "strings", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 156, + "tokens_nocomments": 150, + "bytes": 465, + "pass": true + }, + { + "task": "w17", + "category": "strings", + "lang": "go", + "encoding": "o200k_base", + "tokens": 158, + "tokens_nocomments": 152, + "bytes": 465, + "pass": true + }, + { + "task": "w18", + "category": "strings", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 64, + "tokens_nocomments": 64, + "bytes": 194, + "pass": true + }, + { + "task": "w18", + "category": "strings", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 64, + "tokens_nocomments": 64, + "bytes": 194, + "pass": true + }, + { + "task": "w18", + "category": "strings", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 63, + "tokens_nocomments": 63, + "bytes": 212, + "pass": true + }, + { + "task": "w18", + "category": "strings", + "lang": "python", + "encoding": "o200k_base", + "tokens": 63, + "tokens_nocomments": 63, + "bytes": 212, + "pass": true + }, + { + "task": "w18", + "category": "strings", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 64, + "tokens_nocomments": 64, + "bytes": 224, + "pass": true + }, + { + "task": "w18", + "category": "strings", + "lang": "js", + "encoding": "o200k_base", + "tokens": 70, + "tokens_nocomments": 70, + "bytes": 224, + "pass": true + }, + { + "task": "w18", + "category": "strings", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 165, + "tokens_nocomments": 159, + "bytes": 538, + "pass": true + }, + { + "task": "w18", + "category": "strings", + "lang": "go", + "encoding": "o200k_base", + "tokens": 165, + "tokens_nocomments": 159, + "bytes": 538, + "pass": true + }, + { + "task": "w19", + "category": "strings", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 91, + "tokens_nocomments": 91, + "bytes": 276, + "pass": true + }, + { + "task": "w19", + "category": "strings", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 92, + "tokens_nocomments": 92, + "bytes": 276, + "pass": true + }, + { + "task": "w19", + "category": "strings", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 69, + "tokens_nocomments": 69, + "bytes": 194, + "pass": true + }, + { + "task": "w19", + "category": "strings", + "lang": "python", + "encoding": "o200k_base", + "tokens": 69, + "tokens_nocomments": 69, + "bytes": 194, + "pass": true + }, + { + "task": "w19", + "category": "strings", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 73, + "tokens_nocomments": 73, + "bytes": 236, + "pass": true + }, + { + "task": "w19", + "category": "strings", + "lang": "js", + "encoding": "o200k_base", + "tokens": 81, + "tokens_nocomments": 81, + "bytes": 236, + "pass": true + }, + { + "task": "w19", + "category": "strings", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 129, + "tokens_nocomments": 123, + "bytes": 397, + "pass": true + }, + { + "task": "w19", + "category": "strings", + "lang": "go", + "encoding": "o200k_base", + "tokens": 131, + "tokens_nocomments": 125, + "bytes": 397, + "pass": true + }, + { + "task": "w20", + "category": "strings", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 78, + "tokens_nocomments": 78, + "bytes": 226, + "pass": true + }, + { + "task": "w20", + "category": "strings", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 78, + "tokens_nocomments": 78, + "bytes": 226, + "pass": true + }, + { + "task": "w20", + "category": "strings", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 57, + "tokens_nocomments": 57, + "bytes": 184, + "pass": true + }, + { + "task": "w20", + "category": "strings", + "lang": "python", + "encoding": "o200k_base", + "tokens": 57, + "tokens_nocomments": 57, + "bytes": 184, + "pass": true + }, + { + "task": "w20", + "category": "strings", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 61, + "tokens_nocomments": 61, + "bytes": 215, + "pass": true + }, + { + "task": "w20", + "category": "strings", + "lang": "js", + "encoding": "o200k_base", + "tokens": 65, + "tokens_nocomments": 65, + "bytes": 215, + "pass": true + }, + { + "task": "w20", + "category": "strings", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 125, + "tokens_nocomments": 119, + "bytes": 416, + "pass": true + }, + { + "task": "w20", + "category": "strings", + "lang": "go", + "encoding": "o200k_base", + "tokens": 126, + "tokens_nocomments": 120, + "bytes": 416, + "pass": true + }, + { + "task": "w21", + "category": "records", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 99, + "tokens_nocomments": 99, + "bytes": 295, + "pass": true + }, + { + "task": "w21", + "category": "records", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 99, + "tokens_nocomments": 99, + "bytes": 295, + "pass": true + }, + { + "task": "w21", + "category": "records", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 65, + "tokens_nocomments": 65, + "bytes": 252, + "pass": true + }, + { + "task": "w21", + "category": "records", + "lang": "python", + "encoding": "o200k_base", + "tokens": 65, + "tokens_nocomments": 65, + "bytes": 252, + "pass": true + }, + { + "task": "w21", + "category": "records", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 69, + "tokens_nocomments": 69, + "bytes": 246, + "pass": true + }, + { + "task": "w21", + "category": "records", + "lang": "js", + "encoding": "o200k_base", + "tokens": 73, + "tokens_nocomments": 73, + "bytes": 246, + "pass": true + }, + { + "task": "w21", + "category": "records", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 174, + "tokens_nocomments": 168, + "bytes": 591, + "pass": true + }, + { + "task": "w21", + "category": "records", + "lang": "go", + "encoding": "o200k_base", + "tokens": 175, + "tokens_nocomments": 169, + "bytes": 591, + "pass": true + }, + { + "task": "w22", + "category": "records", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 99, + "tokens_nocomments": 99, + "bytes": 308, + "pass": true + }, + { + "task": "w22", + "category": "records", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 100, + "tokens_nocomments": 100, + "bytes": 308, + "pass": true + }, + { + "task": "w22", + "category": "records", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 88, + "tokens_nocomments": 88, + "bytes": 306, + "pass": true + }, + { + "task": "w22", + "category": "records", + "lang": "python", + "encoding": "o200k_base", + "tokens": 88, + "tokens_nocomments": 88, + "bytes": 306, + "pass": true + }, + { + "task": "w22", + "category": "records", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 104, + "tokens_nocomments": 104, + "bytes": 358, + "pass": true + }, + { + "task": "w22", + "category": "records", + "lang": "js", + "encoding": "o200k_base", + "tokens": 110, + "tokens_nocomments": 110, + "bytes": 358, + "pass": true + }, + { + "task": "w22", + "category": "records", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 226, + "tokens_nocomments": 220, + "bytes": 748, + "pass": true + }, + { + "task": "w22", + "category": "records", + "lang": "go", + "encoding": "o200k_base", + "tokens": 228, + "tokens_nocomments": 222, + "bytes": 748, + "pass": true + }, + { + "task": "w23", + "category": "records", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 90, + "tokens_nocomments": 90, + "bytes": 273, + "pass": true + }, + { + "task": "w23", + "category": "records", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 91, + "tokens_nocomments": 91, + "bytes": 273, + "pass": true + }, + { + "task": "w23", + "category": "records", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 78, + "tokens_nocomments": 78, + "bytes": 277, + "pass": true + }, + { + "task": "w23", + "category": "records", + "lang": "python", + "encoding": "o200k_base", + "tokens": 78, + "tokens_nocomments": 78, + "bytes": 277, + "pass": true + }, + { + "task": "w23", + "category": "records", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 83, + "tokens_nocomments": 83, + "bytes": 287, + "pass": true + }, + { + "task": "w23", + "category": "records", + "lang": "js", + "encoding": "o200k_base", + "tokens": 89, + "tokens_nocomments": 89, + "bytes": 287, + "pass": true + }, + { + "task": "w23", + "category": "records", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 198, + "tokens_nocomments": 192, + "bytes": 638, + "pass": true + }, + { + "task": "w23", + "category": "records", + "lang": "go", + "encoding": "o200k_base", + "tokens": 198, + "tokens_nocomments": 192, + "bytes": 638, + "pass": true + }, + { + "task": "w24", + "category": "records", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 92, + "tokens_nocomments": 92, + "bytes": 270, + "pass": true + }, + { + "task": "w24", + "category": "records", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 92, + "tokens_nocomments": 92, + "bytes": 270, + "pass": true + }, + { + "task": "w24", + "category": "records", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 75, + "tokens_nocomments": 75, + "bytes": 271, + "pass": true + }, + { + "task": "w24", + "category": "records", + "lang": "python", + "encoding": "o200k_base", + "tokens": 75, + "tokens_nocomments": 75, + "bytes": 271, + "pass": true + }, + { + "task": "w24", + "category": "records", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 81, + "tokens_nocomments": 81, + "bytes": 276, + "pass": true + }, + { + "task": "w24", + "category": "records", + "lang": "js", + "encoding": "o200k_base", + "tokens": 85, + "tokens_nocomments": 85, + "bytes": 276, + "pass": true + }, + { + "task": "w24", + "category": "records", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 190, + "tokens_nocomments": 184, + "bytes": 603, + "pass": true + }, + { + "task": "w24", + "category": "records", + "lang": "go", + "encoding": "o200k_base", + "tokens": 190, + "tokens_nocomments": 184, + "bytes": 603, + "pass": true + }, + { + "task": "w25", + "category": "logic", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 128, + "tokens_nocomments": 128, + "bytes": 354, + "pass": true + }, + { + "task": "w25", + "category": "logic", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 128, + "tokens_nocomments": 128, + "bytes": 354, + "pass": true + }, + { + "task": "w25", + "category": "logic", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 77, + "tokens_nocomments": 77, + "bytes": 220, + "pass": true + }, + { + "task": "w25", + "category": "logic", + "lang": "python", + "encoding": "o200k_base", + "tokens": 77, + "tokens_nocomments": 77, + "bytes": 220, + "pass": true + }, + { + "task": "w25", + "category": "logic", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 102, + "tokens_nocomments": 102, + "bytes": 311, + "pass": true + }, + { + "task": "w25", + "category": "logic", + "lang": "js", + "encoding": "o200k_base", + "tokens": 106, + "tokens_nocomments": 106, + "bytes": 311, + "pass": true + }, + { + "task": "w25", + "category": "logic", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 188, + "tokens_nocomments": 182, + "bytes": 569, + "pass": true + }, + { + "task": "w25", + "category": "logic", + "lang": "go", + "encoding": "o200k_base", + "tokens": 190, + "tokens_nocomments": 184, + "bytes": 569, + "pass": true + }, + { + "task": "w26", + "category": "logic", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 94, + "tokens_nocomments": 94, + "bytes": 227, + "pass": true + }, + { + "task": "w26", + "category": "logic", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 94, + "tokens_nocomments": 94, + "bytes": 227, + "pass": true + }, + { + "task": "w26", + "category": "logic", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 72, + "tokens_nocomments": 72, + "bytes": 195, + "pass": true + }, + { + "task": "w26", + "category": "logic", + "lang": "python", + "encoding": "o200k_base", + "tokens": 72, + "tokens_nocomments": 72, + "bytes": 195, + "pass": true + }, + { + "task": "w26", + "category": "logic", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 76, + "tokens_nocomments": 76, + "bytes": 215, + "pass": true + }, + { + "task": "w26", + "category": "logic", + "lang": "js", + "encoding": "o200k_base", + "tokens": 80, + "tokens_nocomments": 80, + "bytes": 215, + "pass": true + }, + { + "task": "w26", + "category": "logic", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 157, + "tokens_nocomments": 151, + "bytes": 458, + "pass": true + }, + { + "task": "w26", + "category": "logic", + "lang": "go", + "encoding": "o200k_base", + "tokens": 160, + "tokens_nocomments": 154, + "bytes": 458, + "pass": true + }, + { + "task": "w27", + "category": "logic", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 91, + "tokens_nocomments": 91, + "bytes": 247, + "pass": true + }, + { + "task": "w27", + "category": "logic", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 92, + "tokens_nocomments": 92, + "bytes": 247, + "pass": true + }, + { + "task": "w27", + "category": "logic", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 95, + "tokens_nocomments": 95, + "bytes": 279, + "pass": true + }, + { + "task": "w27", + "category": "logic", + "lang": "python", + "encoding": "o200k_base", + "tokens": 95, + "tokens_nocomments": 95, + "bytes": 279, + "pass": true + }, + { + "task": "w27", + "category": "logic", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 98, + "tokens_nocomments": 98, + "bytes": 282, + "pass": true + }, + { + "task": "w27", + "category": "logic", + "lang": "js", + "encoding": "o200k_base", + "tokens": 102, + "tokens_nocomments": 102, + "bytes": 282, + "pass": true + }, + { + "task": "w27", + "category": "logic", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 184, + "tokens_nocomments": 178, + "bytes": 548, + "pass": true + }, + { + "task": "w27", + "category": "logic", + "lang": "go", + "encoding": "o200k_base", + "tokens": 185, + "tokens_nocomments": 179, + "bytes": 548, + "pass": true + }, + { + "task": "w28", + "category": "logic", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 146, + "tokens_nocomments": 146, + "bytes": 440, + "pass": true + }, + { + "task": "w28", + "category": "logic", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 147, + "tokens_nocomments": 147, + "bytes": 440, + "pass": true + }, + { + "task": "w28", + "category": "logic", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 133, + "tokens_nocomments": 133, + "bytes": 462, + "pass": true + }, + { + "task": "w28", + "category": "logic", + "lang": "python", + "encoding": "o200k_base", + "tokens": 134, + "tokens_nocomments": 134, + "bytes": 462, + "pass": true + }, + { + "task": "w28", + "category": "logic", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 155, + "tokens_nocomments": 155, + "bytes": 518, + "pass": true + }, + { + "task": "w28", + "category": "logic", + "lang": "js", + "encoding": "o200k_base", + "tokens": 162, + "tokens_nocomments": 162, + "bytes": 518, + "pass": true + }, + { + "task": "w28", + "category": "logic", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 229, + "tokens_nocomments": 223, + "bytes": 712, + "pass": true + }, + { + "task": "w28", + "category": "logic", + "lang": "go", + "encoding": "o200k_base", + "tokens": 231, + "tokens_nocomments": 225, + "bytes": 712, + "pass": true + }, + { + "task": "w29", + "category": "logic", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 108, + "tokens_nocomments": 108, + "bytes": 321, + "pass": true + }, + { + "task": "w29", + "category": "logic", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 108, + "tokens_nocomments": 108, + "bytes": 321, + "pass": true + }, + { + "task": "w29", + "category": "logic", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 90, + "tokens_nocomments": 90, + "bytes": 319, + "pass": true + }, + { + "task": "w29", + "category": "logic", + "lang": "python", + "encoding": "o200k_base", + "tokens": 90, + "tokens_nocomments": 90, + "bytes": 319, + "pass": true + }, + { + "task": "w29", + "category": "logic", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 118, + "tokens_nocomments": 118, + "bytes": 403, + "pass": true + }, + { + "task": "w29", + "category": "logic", + "lang": "js", + "encoding": "o200k_base", + "tokens": 124, + "tokens_nocomments": 124, + "bytes": 403, + "pass": true + }, + { + "task": "w29", + "category": "logic", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 214, + "tokens_nocomments": 208, + "bytes": 696, + "pass": true + }, + { + "task": "w29", + "category": "logic", + "lang": "go", + "encoding": "o200k_base", + "tokens": 217, + "tokens_nocomments": 211, + "bytes": 696, + "pass": true + }, + { + "task": "w30", + "category": "logic", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 163, + "tokens_nocomments": 163, + "bytes": 413, + "pass": true + }, + { + "task": "w30", + "category": "logic", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 163, + "tokens_nocomments": 163, + "bytes": 413, + "pass": true + }, + { + "task": "w30", + "category": "logic", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 140, + "tokens_nocomments": 140, + "bytes": 379, + "pass": true + }, + { + "task": "w30", + "category": "logic", + "lang": "python", + "encoding": "o200k_base", + "tokens": 140, + "tokens_nocomments": 140, + "bytes": 379, + "pass": true + }, + { + "task": "w30", + "category": "logic", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 147, + "tokens_nocomments": 147, + "bytes": 378, + "pass": true + }, + { + "task": "w30", + "category": "logic", + "lang": "js", + "encoding": "o200k_base", + "tokens": 151, + "tokens_nocomments": 151, + "bytes": 378, + "pass": true + }, + { + "task": "w30", + "category": "logic", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 254, + "tokens_nocomments": 248, + "bytes": 715, + "pass": true + }, + { + "task": "w30", + "category": "logic", + "lang": "go", + "encoding": "o200k_base", + "tokens": 255, + "tokens_nocomments": 249, + "bytes": 715, + "pass": true + }, + { + "task": "w31", + "category": "logic", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 104, + "tokens_nocomments": 104, + "bytes": 277, + "pass": true + }, + { + "task": "w31", + "category": "logic", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 104, + "tokens_nocomments": 104, + "bytes": 277, + "pass": true + }, + { + "task": "w31", + "category": "logic", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 49, + "tokens_nocomments": 49, + "bytes": 166, + "pass": true + }, + { + "task": "w31", + "category": "logic", + "lang": "python", + "encoding": "o200k_base", + "tokens": 49, + "tokens_nocomments": 49, + "bytes": 166, + "pass": true + }, + { + "task": "w31", + "category": "logic", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 54, + "tokens_nocomments": 54, + "bytes": 188, + "pass": true + }, + { + "task": "w31", + "category": "logic", + "lang": "js", + "encoding": "o200k_base", + "tokens": 59, + "tokens_nocomments": 59, + "bytes": 188, + "pass": true + }, + { + "task": "w31", + "category": "logic", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 151, + "tokens_nocomments": 145, + "bytes": 483, + "pass": true + }, + { + "task": "w31", + "category": "logic", + "lang": "go", + "encoding": "o200k_base", + "tokens": 152, + "tokens_nocomments": 146, + "bytes": 483, + "pass": true + }, + { + "task": "w32", + "category": "logic", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 142, + "tokens_nocomments": 142, + "bytes": 372, + "pass": true + }, + { + "task": "w32", + "category": "logic", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 143, + "tokens_nocomments": 143, + "bytes": 372, + "pass": true + }, + { + "task": "w32", + "category": "logic", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 124, + "tokens_nocomments": 124, + "bytes": 375, + "pass": true + }, + { + "task": "w32", + "category": "logic", + "lang": "python", + "encoding": "o200k_base", + "tokens": 126, + "tokens_nocomments": 126, + "bytes": 375, + "pass": true + }, + { + "task": "w32", + "category": "logic", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 142, + "tokens_nocomments": 142, + "bytes": 404, + "pass": true + }, + { + "task": "w32", + "category": "logic", + "lang": "js", + "encoding": "o200k_base", + "tokens": 147, + "tokens_nocomments": 147, + "bytes": 404, + "pass": true + }, + { + "task": "w32", + "category": "logic", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 232, + "tokens_nocomments": 226, + "bytes": 674, + "pass": true + }, + { + "task": "w32", + "category": "logic", + "lang": "go", + "encoding": "o200k_base", + "tokens": 237, + "tokens_nocomments": 231, + "bytes": 674, + "pass": true + }, + { + "task": "w33", + "category": "logic", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 143, + "tokens_nocomments": 143, + "bytes": 419, + "pass": true + }, + { + "task": "w33", + "category": "logic", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 145, + "tokens_nocomments": 145, + "bytes": 419, + "pass": true + }, + { + "task": "w33", + "category": "logic", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 95, + "tokens_nocomments": 95, + "bytes": 326, + "pass": true + }, + { + "task": "w33", + "category": "logic", + "lang": "python", + "encoding": "o200k_base", + "tokens": 96, + "tokens_nocomments": 96, + "bytes": 326, + "pass": true + }, + { + "task": "w33", + "category": "logic", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 113, + "tokens_nocomments": 113, + "bytes": 371, + "pass": true + }, + { + "task": "w33", + "category": "logic", + "lang": "js", + "encoding": "o200k_base", + "tokens": 120, + "tokens_nocomments": 120, + "bytes": 371, + "pass": true + }, + { + "task": "w33", + "category": "logic", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 252, + "tokens_nocomments": 246, + "bytes": 781, + "pass": true + }, + { + "task": "w33", + "category": "logic", + "lang": "go", + "encoding": "o200k_base", + "tokens": 255, + "tokens_nocomments": 249, + "bytes": 781, + "pass": true + }, + { + "task": "w34", + "category": "logic", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 227, + "tokens_nocomments": 227, + "bytes": 549, + "pass": true + }, + { + "task": "w34", + "category": "logic", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 227, + "tokens_nocomments": 227, + "bytes": 549, + "pass": true + }, + { + "task": "w34", + "category": "logic", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 145, + "tokens_nocomments": 145, + "bytes": 378, + "pass": true + }, + { + "task": "w34", + "category": "logic", + "lang": "python", + "encoding": "o200k_base", + "tokens": 145, + "tokens_nocomments": 145, + "bytes": 378, + "pass": true + }, + { + "task": "w34", + "category": "logic", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 123, + "tokens_nocomments": 123, + "bytes": 359, + "pass": true + }, + { + "task": "w34", + "category": "logic", + "lang": "js", + "encoding": "o200k_base", + "tokens": 130, + "tokens_nocomments": 130, + "bytes": 359, + "pass": true + }, + { + "task": "w34", + "category": "logic", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 250, + "tokens_nocomments": 244, + "bytes": 642, + "pass": true + }, + { + "task": "w34", + "category": "logic", + "lang": "go", + "encoding": "o200k_base", + "tokens": 251, + "tokens_nocomments": 245, + "bytes": 642, + "pass": true + }, + { + "task": "w35", + "category": "logic", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 140, + "tokens_nocomments": 140, + "bytes": 396, + "pass": true + }, + { + "task": "w35", + "category": "logic", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 141, + "tokens_nocomments": 141, + "bytes": 396, + "pass": true + }, + { + "task": "w35", + "category": "logic", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 100, + "tokens_nocomments": 100, + "bytes": 336, + "pass": true + }, + { + "task": "w35", + "category": "logic", + "lang": "python", + "encoding": "o200k_base", + "tokens": 101, + "tokens_nocomments": 101, + "bytes": 336, + "pass": true + }, + { + "task": "w35", + "category": "logic", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 123, + "tokens_nocomments": 123, + "bytes": 420, + "pass": true + }, + { + "task": "w35", + "category": "logic", + "lang": "js", + "encoding": "o200k_base", + "tokens": 130, + "tokens_nocomments": 130, + "bytes": 420, + "pass": true + }, + { + "task": "w35", + "category": "logic", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 230, + "tokens_nocomments": 224, + "bytes": 742, + "pass": true + }, + { + "task": "w35", + "category": "logic", + "lang": "go", + "encoding": "o200k_base", + "tokens": 234, + "tokens_nocomments": 228, + "bytes": 742, + "pass": true + }, + { + "task": "w36", + "category": "logic", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 110, + "tokens_nocomments": 110, + "bytes": 344, + "pass": true + }, + { + "task": "w36", + "category": "logic", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 111, + "tokens_nocomments": 111, + "bytes": 344, + "pass": true + }, + { + "task": "w36", + "category": "logic", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 111, + "tokens_nocomments": 111, + "bytes": 375, + "pass": true + }, + { + "task": "w36", + "category": "logic", + "lang": "python", + "encoding": "o200k_base", + "tokens": 112, + "tokens_nocomments": 112, + "bytes": 375, + "pass": true + }, + { + "task": "w36", + "category": "logic", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 98, + "tokens_nocomments": 98, + "bytes": 292, + "pass": true + }, + { + "task": "w36", + "category": "logic", + "lang": "js", + "encoding": "o200k_base", + "tokens": 102, + "tokens_nocomments": 102, + "bytes": 292, + "pass": true + }, + { + "task": "w36", + "category": "logic", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 179, + "tokens_nocomments": 173, + "bytes": 624, + "pass": true + }, + { + "task": "w36", + "category": "logic", + "lang": "go", + "encoding": "o200k_base", + "tokens": 180, + "tokens_nocomments": 174, + "bytes": 624, + "pass": true + }, + { + "task": "w37", + "category": "logic", + "lang": "howl", + "encoding": "cl100k_base", + "tokens": 199, + "tokens_nocomments": 199, + "bytes": 468, + "pass": true + }, + { + "task": "w37", + "category": "logic", + "lang": "howl", + "encoding": "o200k_base", + "tokens": 200, + "tokens_nocomments": 200, + "bytes": 468, + "pass": true + }, + { + "task": "w37", + "category": "logic", + "lang": "python", + "encoding": "cl100k_base", + "tokens": 160, + "tokens_nocomments": 160, + "bytes": 358, + "pass": true + }, + { + "task": "w37", + "category": "logic", + "lang": "python", + "encoding": "o200k_base", + "tokens": 161, + "tokens_nocomments": 161, + "bytes": 358, + "pass": true + }, + { + "task": "w37", + "category": "logic", + "lang": "js", + "encoding": "cl100k_base", + "tokens": 168, + "tokens_nocomments": 168, + "bytes": 386, + "pass": true + }, + { + "task": "w37", + "category": "logic", + "lang": "js", + "encoding": "o200k_base", + "tokens": 174, + "tokens_nocomments": 174, + "bytes": 386, + "pass": true + }, + { + "task": "w37", + "category": "logic", + "lang": "go", + "encoding": "cl100k_base", + "tokens": 240, + "tokens_nocomments": 234, + "bytes": 591, + "pass": true + }, + { + "task": "w37", + "category": "logic", + "lang": "go", + "encoding": "o200k_base", + "tokens": 242, + "tokens_nocomments": 236, + "bytes": 591, + "pass": true + } +] diff --git a/experiments/token-efficiency-heldout-v2/results/verification.json b/experiments/token-efficiency-heldout-v2/results/verification.json new file mode 100644 index 0000000..e87ce1e --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/results/verification.json @@ -0,0 +1,890 @@ +[ + { + "task": "w01", + "lang": "howl", + "pass": true, + "sha256": "e779d4ada79d03b535ce152623cda127f76593ad4b4c0e9eea159048ac499945" + }, + { + "task": "w02", + "lang": "howl", + "pass": true, + "sha256": "a48eabcdf78c948bbf9633fce496c42b190fdd830b7b144b1edb6b4778c5b452" + }, + { + "task": "w03", + "lang": "howl", + "pass": true, + "sha256": "b76e261279f823f599761636a6039cfff86768deb51c671a84fee3aa2fd83fd4" + }, + { + "task": "w04", + "lang": "howl", + "pass": true, + "sha256": "c39a41f1c33ff2c36ad5f51770bf32cb411f27c05bc998a402fb00db2e34d5d1" + }, + { + "task": "w05", + "lang": "howl", + "pass": true, + "sha256": "f0cc69e3c9b93db019d684a3d661532555e46385c5b91ada0021c1fcc2c26c30" + }, + { + "task": "w06", + "lang": "howl", + "pass": true, + "sha256": "65f4a851178cca27ada225ba7ab5d9b2f1141e70853780214ab23b49481d125e" + }, + { + "task": "w07", + "lang": "howl", + "pass": true, + "sha256": "eaee24b07aa85ba0796496a17f6c63c2c91687ca53aa3b8daf4c26b33c07befa" + }, + { + "task": "w08", + "lang": "howl", + "pass": true, + "sha256": "7bb990d62932c3c300853fe57a716de573d130bb72cffc991fa419fe49c5b785" + }, + { + "task": "w09", + "lang": "howl", + "pass": true, + "sha256": "8ba607235c1d5de19e32cce294baf29a4598651cd378736fb9eab961240ec8da" + }, + { + "task": "w10", + "lang": "howl", + "pass": true, + "sha256": "d957e4b13cb2ccdd71a16345fc28c8761902801af291aacd68df00a1492ef090" + }, + { + "task": "w11", + "lang": "howl", + "pass": true, + "sha256": "e459178df792ebe9d8e8e52a6a9e77dcc62ea6b32f6f7346d8ed56573a326005" + }, + { + "task": "w12", + "lang": "howl", + "pass": true, + "sha256": "009a168942fbd98cdf069c34181848e2ea42098c6417ea35eef562d2ae821e8e" + }, + { + "task": "w13", + "lang": "howl", + "pass": true, + "sha256": "2e25a4045719ba5cf212e0da4d91d3dc66b0b21be2226bde3691f539ef922767" + }, + { + "task": "w14", + "lang": "howl", + "pass": true, + "sha256": "77c39cf99356048ddee1ed13691b0282f62c657ee550c227ea8e6b18cb4b8086" + }, + { + "task": "w15", + "lang": "howl", + "pass": true, + "sha256": "0d4f56022ce762197e1645877879ba8962f34512e6d43e472a4696ab177a6fda" + }, + { + "task": "w16", + "lang": "howl", + "pass": true, + "sha256": "aa0cb71dc34c0d54b692fe53199d59c690d76948e10ea675bc8bbd93cd701113" + }, + { + "task": "w17", + "lang": "howl", + "pass": true, + "sha256": "67e12021e5019c40fec17b53990f2f87ea043fdd6ed98d3a7c318a4c63110517" + }, + { + "task": "w18", + "lang": "howl", + "pass": true, + "sha256": "b785f8874ff49d4278b3a8c0ad2a41eaea5652f88305d4529a09b0c0e2c68918" + }, + { + "task": "w19", + "lang": "howl", + "pass": true, + "sha256": "90bc25a0dd3a48bcc0300c5f158c9baa3e4d1bddd680522bfe14a4e2fd75e895" + }, + { + "task": "w20", + "lang": "howl", + "pass": true, + "sha256": "3023eab63cbf6585846fe9f7c11374f6d7480de11e3044d97cb3c8360aeee373" + }, + { + "task": "w21", + "lang": "howl", + "pass": true, + "sha256": "64e175ebc99f90964ec9f26d07d6235742394ac34c5714bf89eea40dfa6c3e15" + }, + { + "task": "w22", + "lang": "howl", + "pass": true, + "sha256": "7f5f8c2b87e13c5628869ddcf999ba68af253d23f606208a59c51e090d0828bb" + }, + { + "task": "w23", + "lang": "howl", + "pass": true, + "sha256": "f8ea407bc1785b1c4a2d5a380c867b583c54de4815957b4653155a913065f989" + }, + { + "task": "w24", + "lang": "howl", + "pass": true, + "sha256": "4ba5491355c224b7b7f5214b32c0d9f6f6175ed7bc18c505d17255018f7a0159" + }, + { + "task": "w25", + "lang": "howl", + "pass": true, + "sha256": "e63307c91e83aff0edd43fc9dbf3b8212e75f07bbd6c149f77a43e45e92dab45" + }, + { + "task": "w26", + "lang": "howl", + "pass": true, + "sha256": "e682c071edbc280159e3b90ba86d6411dd89ec66aaa7edae1804a4596447bae1" + }, + { + "task": "w27", + "lang": "howl", + "pass": true, + "sha256": "edf812bbc0440e6aa3ebd24a47e44f2f763838432bc1139de9e819979a70853b" + }, + { + "task": "w28", + "lang": "howl", + "pass": true, + "sha256": "e6a820adaf2d59570baf519d7cdc3134992bfaf3468eade7f56d2de9ab77cd1f" + }, + { + "task": "w29", + "lang": "howl", + "pass": true, + "sha256": "b1b157cac9ec3d392cfb94061e42e7ab066128355468768497d065bc0a8fb2d9" + }, + { + "task": "w30", + "lang": "howl", + "pass": true, + "sha256": "4bcc103d7ddf3e61c2351611b9bc3e96938841ea4cf8bbe1c66eb7b18e276670" + }, + { + "task": "w31", + "lang": "howl", + "pass": true, + "sha256": "da46933b8f4ae018b718e723e2fba0e59f6f8fdca2c9ddc2c930d96650b89436" + }, + { + "task": "w32", + "lang": "howl", + "pass": true, + "sha256": "c90e5953abf32be8213f6ed0dfe7604fad895168d3760bcf5b5cd89d5b8aa4af" + }, + { + "task": "w33", + "lang": "howl", + "pass": true, + "sha256": "97fcfdbba2b286ef7dbefa9524bc22fdab55e9eda706f88cf3dd90ce245a2319" + }, + { + "task": "w34", + "lang": "howl", + "pass": true, + "sha256": "c3a07057f53e80df0abe84caa21efb89d8fe3d185b9ae4f1ee3e90fec19e8dbe" + }, + { + "task": "w35", + "lang": "howl", + "pass": true, + "sha256": "aa271d145b3bfb5f799bfe9389bfa892f37d861972fd4d029ad0a0c4d1ec29b0" + }, + { + "task": "w36", + "lang": "howl", + "pass": true, + "sha256": "9e013579a9ba2456a6e4d4e22f32508cf92fae7c95ca9dd96bcef448f2def0b5" + }, + { + "task": "w37", + "lang": "howl", + "pass": true, + "sha256": "6e18c0ba411402855aee97483fc2dcbcb9adaabcb85e66bc91550e10c48524e9" + }, + { + "task": "w01", + "lang": "python", + "pass": true, + "sha256": "8f3118ecacd3fdc72f4224d7080fb648f6a8326fab9356d4abfb61faa6e2cb12" + }, + { + "task": "w02", + "lang": "python", + "pass": true, + "sha256": "02259e2bc8e0b86000545a529420d4aeb8e1bd69d34ba2fa5b03edad8e4a450d" + }, + { + "task": "w03", + "lang": "python", + "pass": true, + "sha256": "3ebab7139b6bf7a2d2ecfe34c2fb488dffff58fa16203036f86c3e354ac53042" + }, + { + "task": "w04", + "lang": "python", + "pass": true, + "sha256": "d304662da1a6aa1b02f4f34a67a093856dd6d063341991e61ea094b7df6369e8" + }, + { + "task": "w05", + "lang": "python", + "pass": true, + "sha256": "623123a24a3143a438a12617be48c209f78391b273faa1f3d79ee7fedc59ed23" + }, + { + "task": "w06", + "lang": "python", + "pass": true, + "sha256": "16aa2a2f58a3d919bb288d753589854dd387f28831f7f9843c8e733b38e57d8f" + }, + { + "task": "w07", + "lang": "python", + "pass": true, + "sha256": "66819bae1962d4647ad1ed97224e61e7060af6c1c03d7d36c00e30f7ac3e6234" + }, + { + "task": "w08", + "lang": "python", + "pass": true, + "sha256": "e80000e27a0ed99c46f09b6e266be4e96ae25db6ec8cd5af12722623a5f6f5f5" + }, + { + "task": "w09", + "lang": "python", + "pass": true, + "sha256": "0432547b54351daf909eafdf74fb3886ce30f00c40fb2f49867d89535c888eb0" + }, + { + "task": "w10", + "lang": "python", + "pass": true, + "sha256": "d06addd3867c2a4c4170ffc14cdfd5b9bd1134943dd542fdd4a0796b2eb3713d" + }, + { + "task": "w11", + "lang": "python", + "pass": true, + "sha256": "e7342796db038545f62e91487abe9af787b52e632c96d9b3281455b12c5e8344" + }, + { + "task": "w12", + "lang": "python", + "pass": true, + "sha256": "18cc0936cbfbcbc9d95d29314d7292fa46147aeb2975af7fff49acb3edfd04eb" + }, + { + "task": "w13", + "lang": "python", + "pass": true, + "sha256": "4cb516a6b946b6db89f9cca39e36535c8be51ac172bf68204f5aa81e8385353d" + }, + { + "task": "w14", + "lang": "python", + "pass": true, + "sha256": "1f4b3e4fbfa3523cbf467d62e33fc0e466a7e093a46123d1c0b579a160b95ccb" + }, + { + "task": "w15", + "lang": "python", + "pass": true, + "sha256": "c8371730f88f881a22849dd386d0a3be17ed6f15f122e347c03e0c88d12635b3" + }, + { + "task": "w16", + "lang": "python", + "pass": true, + "sha256": "59f91c126ae151e78a9a4491a51e6907b782a056f36250928af95132dbe0edc4" + }, + { + "task": "w17", + "lang": "python", + "pass": true, + "sha256": "059551fcd28f57da72abe17b45a84ef8bb5cdc9a106e0f7b29a18bb454dff36b" + }, + { + "task": "w18", + "lang": "python", + "pass": true, + "sha256": "1f7cc3226d7fd5a75f7d94be22d988806c4cf2ecd10edb2160d98dbf20c5f2db" + }, + { + "task": "w19", + "lang": "python", + "pass": true, + "sha256": "567645c1f53be895af50b1e5e68104347892fa38465e40088ed1b4e8b54324a6" + }, + { + "task": "w20", + "lang": "python", + "pass": true, + "sha256": "a80c124a5229b4ecd88fffc7d0958e411029a999c133314de93af2940d702083" + }, + { + "task": "w21", + "lang": "python", + "pass": true, + "sha256": "493cf8cc59109b80cb7c098b20f59bba8b70191ebf44935a4159007cd51e4976" + }, + { + "task": "w22", + "lang": "python", + "pass": true, + "sha256": "64afb3795b1d858a9027a37081a49ef9b36a55a753c13faa518ccb5d71c667ee" + }, + { + "task": "w23", + "lang": "python", + "pass": true, + "sha256": "d7251212994688840f13c5b67ba0e91f481d0b277c01ece578c9d5b86bd2e3c1" + }, + { + "task": "w24", + "lang": "python", + "pass": true, + "sha256": "edef493f38edef1449f4759b8e29aa9a32bdf2931b82d35eabbe09132fea120a" + }, + { + "task": "w25", + "lang": "python", + "pass": true, + "sha256": "45a08a55f2e5bead6874279c18c9964549f3aeea33f3511de4d7f976f944868f" + }, + { + "task": "w26", + "lang": "python", + "pass": true, + "sha256": "bcaa8eb13bb5dc893672f726e6278f1319b362caedb8664842f71fb4de77c231" + }, + { + "task": "w27", + "lang": "python", + "pass": true, + "sha256": "5761fc1264eb64482bcb002514e8dd51ead52cbf6d1192533b0fabd36ef6b12b" + }, + { + "task": "w28", + "lang": "python", + "pass": true, + "sha256": "2833fbbc0300cabc213dc4e996a0afe533284f9f57efc34ba02d5942d9919e81" + }, + { + "task": "w29", + "lang": "python", + "pass": true, + "sha256": "19176d672273ddbd77b866ecf522970f216039416d860b60f2ed5d38a53267aa" + }, + { + "task": "w30", + "lang": "python", + "pass": true, + "sha256": "19e9dff0c476a39e6f591d978628584c611b3805fe4e5c52c55fbc93a710258a" + }, + { + "task": "w31", + "lang": "python", + "pass": true, + "sha256": "ed559cc8e3ebef4eaf230c8c6b81cfaed3106b2a861df4097df7cd86406003ab" + }, + { + "task": "w32", + "lang": "python", + "pass": true, + "sha256": "ec6220a5dbe978021db89a1649cb949b4dceb62eba03ef74996913a32dcffe43" + }, + { + "task": "w33", + "lang": "python", + "pass": true, + "sha256": "2a47f5194782d5d6241ecc0fe5c6904e35ccefca7932ff9522a9d871e31de068" + }, + { + "task": "w34", + "lang": "python", + "pass": true, + "sha256": "17ee5eafbc9a671dc2d9066bd2a316a79e8d9a7ea215fb44f7a3f4eefde96d2e" + }, + { + "task": "w35", + "lang": "python", + "pass": true, + "sha256": "77a2a5f511d440e272074d180f6f55db74c6ebe40f20b3aa706f9dc19b9067a3" + }, + { + "task": "w36", + "lang": "python", + "pass": true, + "sha256": "f9a81cc29797981a1a5ee17e01b2b0e854cacd5258d1ad152117943ded81e346" + }, + { + "task": "w37", + "lang": "python", + "pass": true, + "sha256": "6198f8e8b6df14d10bb86d30edd92659d12b97ba7ea730ac8e5dd5cb6389a773" + }, + { + "task": "w01", + "lang": "js", + "pass": true, + "sha256": "c5c591a7c44119ccdf87a4d3503e481a2135f5ec437bdb3ef1a81b4d817c0aaf" + }, + { + "task": "w02", + "lang": "js", + "pass": true, + "sha256": "1ad3252a423581c6e32f4452924c17f23dbc8c04f5893c59e356d2b8225a3b47" + }, + { + "task": "w03", + "lang": "js", + "pass": true, + "sha256": "e77fe2c38cb78c8685ecec976812911483a23ea09206090aa90ae9585d3cd3f6" + }, + { + "task": "w04", + "lang": "js", + "pass": true, + "sha256": "b7edb0d60535746e41e7f2c4d5f283ac6003b1164727b29abdbacdf0f134f83b" + }, + { + "task": "w05", + "lang": "js", + "pass": true, + "sha256": "549246ee7ec3c0e57f174cb43c9c2bb9d2ac71fee103a93ff5d21a77fa8abf79" + }, + { + "task": "w06", + "lang": "js", + "pass": true, + "sha256": "746a1e6a08fff40dd688329f8d1bc539800b1ca4630ca2ec9a3d643d98384a02" + }, + { + "task": "w07", + "lang": "js", + "pass": true, + "sha256": "ddf8d9771d37ebd9dfae094a0193483769978f998f47d6d25fc5fe5758908fd6" + }, + { + "task": "w08", + "lang": "js", + "pass": true, + "sha256": "5be9c13a9956a91ffa9793c3314b7b6571fe50cd922fe635ed6c670606ea31bf" + }, + { + "task": "w09", + "lang": "js", + "pass": true, + "sha256": "00a9c1cb7702f1206b31148fd32a6c272f39002d978f487864ac499b3db645a0" + }, + { + "task": "w10", + "lang": "js", + "pass": true, + "sha256": "c2e026ff8b3f64c047bb7bed65f6986b7eb15cfff7b1ac21386931819a3d5d05" + }, + { + "task": "w11", + "lang": "js", + "pass": true, + "sha256": "4ebb05b6730b2adf63cd041f67b2f17c7d5335fe42a1304029dbf18270a9ccd2" + }, + { + "task": "w12", + "lang": "js", + "pass": true, + "sha256": "91b81dd2fd81489dc6d9c4f3da67aed0f637df3d4688017f0ab00628c2fd2ec7" + }, + { + "task": "w13", + "lang": "js", + "pass": true, + "sha256": "9dcd83c6bf7ea6ea8708dc26e5b5efda76dc0d329b0b67611b6d2f1441642cce" + }, + { + "task": "w14", + "lang": "js", + "pass": true, + "sha256": "b5a64fdadb9892daf12a10fef5cd52008076d161aa7c02256a787803edc8d70c" + }, + { + "task": "w15", + "lang": "js", + "pass": true, + "sha256": "bd237511847cc5e65b4a75cc5160fd128bc64d9663fcb82c13bb3840baac783e" + }, + { + "task": "w16", + "lang": "js", + "pass": true, + "sha256": "18122820d494dcd3b38323e17195f4f90b5213574e8728cc3c2e50d3575d4fbb" + }, + { + "task": "w17", + "lang": "js", + "pass": true, + "sha256": "bff46c067ed8799c7d2d9b73e41eb0fd0e839b7a9a7bd1baa0092b4159d405a2" + }, + { + "task": "w18", + "lang": "js", + "pass": true, + "sha256": "b58541be55dd1d539bda7dd93923ff2e81654ebc7669ba3d01c3d2524504e7d3" + }, + { + "task": "w19", + "lang": "js", + "pass": true, + "sha256": "721e5df61cafec6e6ff993356810e8230276e8870e4151cc5d3c886b502fd034" + }, + { + "task": "w20", + "lang": "js", + "pass": true, + "sha256": "d7487549080d89140bb5db72dc7679bfe86f1d67f71989fe197618fa88194432" + }, + { + "task": "w21", + "lang": "js", + "pass": true, + "sha256": "92cb0621d276228ee322c5bc12c28f7242684f0b3cf66ed7c9021ea78b5738ae" + }, + { + "task": "w22", + "lang": "js", + "pass": true, + "sha256": "f48cb0cfd1853763b19afd4c59f0eb3a47ff12dd77d5ce47b8cf07b3e086503c" + }, + { + "task": "w23", + "lang": "js", + "pass": true, + "sha256": "0a7f6d41078841346cfdc85e43b2c51c2a4541d6db5f6b2f416fce66fd8186be" + }, + { + "task": "w24", + "lang": "js", + "pass": true, + "sha256": "3fb08821c62c948b5b29f266428a6d247baf082afd76654edcc9fe4c715ba72c" + }, + { + "task": "w25", + "lang": "js", + "pass": true, + "sha256": "bed28c9def238d97635a6539e096b6a883beb159830b955b42835c12a86da18a" + }, + { + "task": "w26", + "lang": "js", + "pass": true, + "sha256": "f7029b3bced1b3e328be870c0641b95a5afd6daf227cd888304697f9d90cc426" + }, + { + "task": "w27", + "lang": "js", + "pass": true, + "sha256": "554be662d6d96d584286779d08b6d9791ee79a4e979c008cf7f1e8ad2d10f96a" + }, + { + "task": "w28", + "lang": "js", + "pass": true, + "sha256": "659b9420e06ca3db3dab0ded8c7d3eefb129708fec94ed7600593e8a43919afe" + }, + { + "task": "w29", + "lang": "js", + "pass": true, + "sha256": "3581b6a69a80abe5df3033f4864b0525141dc4ef173714b4e0a8e403989c6956" + }, + { + "task": "w30", + "lang": "js", + "pass": true, + "sha256": "f2a7579f2a1e8b2a931c46b8b95d3a31e62fe632c88190c229808c0e6f2e6ae0" + }, + { + "task": "w31", + "lang": "js", + "pass": true, + "sha256": "9c205e26261ff4481a179f8a5b8ce8a77439fbda32ee58b4163ce1f05c0d000c" + }, + { + "task": "w32", + "lang": "js", + "pass": true, + "sha256": "dd96fb4446f03706d44e6913454259f850309b7f0be4bef5ca5bbf86e3be552b" + }, + { + "task": "w33", + "lang": "js", + "pass": true, + "sha256": "9c5ce0654c1cb728867fd7b1c1f0be70cfb49826795d2cef15965807f93c7712" + }, + { + "task": "w34", + "lang": "js", + "pass": true, + "sha256": "b230aa0de6bc6af9a92c1ebd24cb03b7fe493d578f5d42747a721a7e05c20154" + }, + { + "task": "w35", + "lang": "js", + "pass": true, + "sha256": "e46b3e6c8d4596f97b276c0431d1639d2e496937ef134c4ef9dce4c924d1c139" + }, + { + "task": "w36", + "lang": "js", + "pass": true, + "sha256": "d4727175d96f79a05e3515973c5c3d9c5441d623b80e77b6cbdb30378a9a94f0" + }, + { + "task": "w37", + "lang": "js", + "pass": true, + "sha256": "030a045d39e27f7d40aedd6cf4e248e98397087903360d2778d6b7c799c88361" + }, + { + "task": "w01", + "lang": "go", + "pass": true, + "sha256": "1cb610c66e93224c93f999f32efd926186cd6e6cf0cdcb35aebfe5876e872730" + }, + { + "task": "w02", + "lang": "go", + "pass": true, + "sha256": "ce6c25a4c7b3a46a92393570abf855bacc5a0583eba941b0eeb8a75848dbeb8c" + }, + { + "task": "w03", + "lang": "go", + "pass": true, + "sha256": "6f9fc67915d5f8ff281dbd4c3cb0c2da0f766f8815ea019055d4b9604c8c1540" + }, + { + "task": "w04", + "lang": "go", + "pass": true, + "sha256": "7b4203c9fe5d5266bf2601070f5e1eb7cf84bbf37576bdcafb8c9bdd4ed2bd9c" + }, + { + "task": "w05", + "lang": "go", + "pass": true, + "sha256": "27788c55ab109b078df03901e875068011473c2e696b57e50d21556e8f2c79cd" + }, + { + "task": "w06", + "lang": "go", + "pass": true, + "sha256": "f8cab76ebff97739c66e259b0ef372e63d87c87846fe0a7377fe893f86c778b1" + }, + { + "task": "w07", + "lang": "go", + "pass": true, + "sha256": "4691a4acb4bcc607f94f3cdf83d413d31cc7fdf2b731fa6fe7ba7db54e10df15" + }, + { + "task": "w08", + "lang": "go", + "pass": true, + "sha256": "4ead3ca21cc3c84f7b27f831798d0721a23e184467a3d4d5af5b47d1f7e7e805" + }, + { + "task": "w09", + "lang": "go", + "pass": true, + "sha256": "1b01ef1070e578c4e24e32c9391f5f711731a1c9e63b378108d80e0e265e0345" + }, + { + "task": "w10", + "lang": "go", + "pass": true, + "sha256": "9c93eb50f60e5f04cf6e790261ab08f437b20bfea39567b2a5e7aeb44359815e" + }, + { + "task": "w11", + "lang": "go", + "pass": true, + "sha256": "5b1d1cf4beab3fa6fdeaa156b7bcda80c074ee924366cc8ebdd3423667bab01b" + }, + { + "task": "w12", + "lang": "go", + "pass": true, + "sha256": "cdbcbda7889abcec6b5011397ff648210336934faf6095c3b4aa9d8862593c64" + }, + { + "task": "w13", + "lang": "go", + "pass": true, + "sha256": "5fdc1f8426d8402e6967165d67f03a4a5b0c2042ec3eae52adc316b173b3b3a2" + }, + { + "task": "w14", + "lang": "go", + "pass": true, + "sha256": "39ea81b03e7b28187df1f46cf0de5124be5c7ee33ed983e91844552dd925133a" + }, + { + "task": "w15", + "lang": "go", + "pass": true, + "sha256": "6966b093a335e91203216f78908bfcd3a5d4786aaf39224f36667705695a6943" + }, + { + "task": "w16", + "lang": "go", + "pass": true, + "sha256": "a9e7755d4edfcbb341e48ab44e8fe1302eee9314b255f07a500e97971d78d00c" + }, + { + "task": "w17", + "lang": "go", + "pass": true, + "sha256": "36260b5a840d2860ca6a414ebfb8cbe70dc156523869544ea29a81aaad1000d6" + }, + { + "task": "w18", + "lang": "go", + "pass": true, + "sha256": "19863fb20722c8ed3e825ba945cfe96ae744a039645427eb8df2f05a0999d37d" + }, + { + "task": "w19", + "lang": "go", + "pass": true, + "sha256": "43fa83f674ca0f389064f3459690bf56b7c93012d2a0e4509c52d0b7da443179" + }, + { + "task": "w20", + "lang": "go", + "pass": true, + "sha256": "0d33eecd654e1c3bd362984822e89303356c9ca74cdec279c6534697f51d13f6" + }, + { + "task": "w21", + "lang": "go", + "pass": true, + "sha256": "75c8fd4190645f76d0b183df63521c860b9ae8557a6fc42fba46f2f74bfd407a" + }, + { + "task": "w22", + "lang": "go", + "pass": true, + "sha256": "c69dc057e04312eda1006ff2c2e7cc17bfcc19224ba911867248655d60c00795" + }, + { + "task": "w23", + "lang": "go", + "pass": true, + "sha256": "a60e29bb53f740977c3cca0ecbc38db054286077f9fd8ba4b9d0bb9ccb8a99cd" + }, + { + "task": "w24", + "lang": "go", + "pass": true, + "sha256": "746a2303c0e8de6587406c27667c661ce9d6cd57f1706e91743b4cd792256803" + }, + { + "task": "w25", + "lang": "go", + "pass": true, + "sha256": "3210e6658360234681380540ee0688c0a2af03168827a35bdf6042c7cbb55e25" + }, + { + "task": "w26", + "lang": "go", + "pass": true, + "sha256": "cdc2ed6aa7841aacaa6a9a0b30b0b7ce0deabfae212fd38694b5c22295bcdd8f" + }, + { + "task": "w27", + "lang": "go", + "pass": true, + "sha256": "7493a0f8647a10d1d470e3171a0b7d2d129b2281bd2bd4dc873ffa1421bf919b" + }, + { + "task": "w28", + "lang": "go", + "pass": true, + "sha256": "a8af038da85a66be55b02702b8f661d7e06cff191fd2315fbdeed69f5b6e45d3" + }, + { + "task": "w29", + "lang": "go", + "pass": true, + "sha256": "37d65c825351b610ed83c213ddabf18a1e9cf2d3a2420b7cf6f98b2e457d77ba" + }, + { + "task": "w30", + "lang": "go", + "pass": true, + "sha256": "e968bc037313c3744aa2d37d5aeae24ba7a1909e0ee53537abcb76ed33e3cad6" + }, + { + "task": "w31", + "lang": "go", + "pass": true, + "sha256": "9e248610f0ebca5e8f53e52e4949f5b5aee68e276da26dfffdc40240cf15c87c" + }, + { + "task": "w32", + "lang": "go", + "pass": true, + "sha256": "8127f3538eddf69d4d1c3ce9ee62347b3b59c021813134e74339d1b8839b82f8" + }, + { + "task": "w33", + "lang": "go", + "pass": true, + "sha256": "e45a2b82a6aaf636162155e9b3cfed3e0841b392ddb55fc81276c80953fa54ec" + }, + { + "task": "w34", + "lang": "go", + "pass": true, + "sha256": "044b22cd00a02c01988d9df6c6c8eb9283cfdccacc894b59b589f483dd53d177" + }, + { + "task": "w35", + "lang": "go", + "pass": true, + "sha256": "0c6c1b658315c6cc5660163d537d4cd823360c926c70790e14862c6cd904ee9d" + }, + { + "task": "w36", + "lang": "go", + "pass": true, + "sha256": "8886a0d175ffc4f93df5c6493bc21a8b24f1c2fb231f1664c5e1199670578218" + }, + { + "task": "w37", + "lang": "go", + "pass": true, + "sha256": "29249a8e0900d839ac59ec0defbdb79755cc87a440a391b390c26e64c69f60b7" + } +] diff --git a/experiments/token-efficiency-heldout-v2/results_freeze_test.go b/experiments/token-efficiency-heldout-v2/results_freeze_test.go new file mode 100644 index 0000000..59af26c --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/results_freeze_test.go @@ -0,0 +1,30 @@ +package heldoutv2 + +import ( + "crypto/sha256" + "fmt" + "os" + "testing" +) + +// The heldout-v2 baseline on main 576c87c1 (before any control-flow change) +// is frozen: the recorded gaps and results must match the hashes pinned here. +// Re-running run.sh on the same commit reproduces these bytes. +func TestHeldoutV2BaselineResultsFrozen(t *testing.T) { + frozen := map[string]string{ + "gaps.json": "37517e5f3dc66819f61f5a7bb8ace1921282415f10551d2defa5c3eb0985b570", + "results/summary.json": "bc27b0e6f6ae10285e2423d8fac0386b10ca0cd26421a397691b538714930370", + "results/tokens.csv": "a892a9018132e0f1d8acc3e2892c089259c906965a18bb4abce192ed9136fd3e", + "results/tokens.json": "499578ce5b2cef3923a3681a2ecbe0c74c4a2816b16bc2754da6ff1b5a8cfdf8", + "results/verification.json": "a326ae813d783989b8c5a894bf6baabb7761c23b6f9dd49c7a719948d8527594", + } + for path, want := range frozen { + data, err := os.ReadFile(path) + if err != nil { + t.Fatal(err) + } + if got := fmt.Sprintf("%x", sha256.Sum256(data)); got != want { + t.Errorf("%s changed after baseline freeze: %s", path, got) + } + } +} diff --git a/experiments/token-efficiency-heldout-v2/run.sh b/experiments/token-efficiency-heldout-v2/run.sh new file mode 100755 index 0000000..0b10f66 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/run.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")/../.." +export GOCACHE="${GOCACHE:-/tmp/hf-token-go-cache}" +go build -o /tmp/howlframe . +go build -o /tmp/heldoutv2verify ./experiments/token-efficiency-heldout-v2/cmd/heldoutv2verify +status=0 +/tmp/heldoutv2verify -howlframe /tmp/howlframe || status=$? +if [ "$status" -eq 0 ]; then + "${TOKBENCH_PYTHON:-python3}" experiments/token-efficiency-heldout-v2/count_tokens.py +fi +exit "$status" diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w01.go b/experiments/token-efficiency-heldout-v2/solutions/go/w01.go new file mode 100644 index 0000000..572463c --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w01.go @@ -0,0 +1,31 @@ +//go:build ignore + +package main + +import ( + "os" + "strings" +) + +func main() { + data, err := os.ReadFile("in/para.txt") + if err != nil { + panic(err) + } + var out []string + cur := "" + for _, word := range strings.Fields(string(data)) { + if cur == "" { + cur = word + } else if len(cur)+1+len(word) <= 20 { + cur += " " + word + } else { + out = append(out, cur) + cur = word + } + } + out = append(out, cur) + if err := os.WriteFile("out/result.txt", []byte(strings.Join(out, "\n")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w02.go b/experiments/token-efficiency-heldout-v2/solutions/go/w02.go new file mode 100644 index 0000000..7922453 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w02.go @@ -0,0 +1,24 @@ +//go:build ignore + +package main + +import ( + "os" + "strings" +) + +func main() { + data, err := os.ReadFile("in/events.txt") + if err != nil { + panic(err) + } + var out []string + for _, line := range strings.Split(string(data), "\n") { + if len(out) == 0 || out[len(out)-1] != line { + out = append(out, line) + } + } + if err := os.WriteFile("out/result.txt", []byte(strings.Join(out, "\n")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w03.go b/experiments/token-efficiency-heldout-v2/solutions/go/w03.go new file mode 100644 index 0000000..e1d7e31 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w03.go @@ -0,0 +1,25 @@ +//go:build ignore + +package main + +import ( + "os" + "strings" +) + +func main() { + data, err := os.ReadFile("in/settings.txt") + if err != nil { + panic(err) + } + var out []string + for _, line := range strings.Split(string(data), "\n") { + line, _, _ = strings.Cut(line, "#") + if line = strings.TrimRight(line, " "); line != "" { + out = append(out, line) + } + } + if err := os.WriteFile("out/result.txt", []byte(strings.Join(out, "\n")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w04.go b/experiments/token-efficiency-heldout-v2/solutions/go/w04.go new file mode 100644 index 0000000..9e46a03 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w04.go @@ -0,0 +1,28 @@ +//go:build ignore + +package main + +import ( + "os" + "strings" +) + +func main() { + data, err := os.ReadFile("in/headings.txt") + if err != nil { + panic(err) + } + lines := strings.Split(string(data), "\n") + for i, line := range lines { + words := strings.Split(line, " ") + for j, w := range words { + if w != "" { + words[j] = strings.ToUpper(w[:1]) + w[1:] + } + } + lines[i] = strings.Join(words, " ") + } + if err := os.WriteFile("out/result.txt", []byte(strings.Join(lines, "\n")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w05.go b/experiments/token-efficiency-heldout-v2/solutions/go/w05.go new file mode 100644 index 0000000..394c814 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w05.go @@ -0,0 +1,33 @@ +//go:build ignore + +package main + +import ( + "encoding/json" + "os" + "strconv" + "strings" +) + +func main() { + data, err := os.ReadFile("in/ledger.csv") + if err != nil { + panic(err) + } + out := map[string]int{} + for _, line := range strings.Split(string(data), "\n")[1:] { + r := strings.Split(line, ",") + amount, err := strconv.Atoi(r[2]) + if err != nil { + panic(err) + } + out[r[1]] += amount + } + enc, err := json.MarshalIndent(out, "", " ") + if err != nil { + panic(err) + } + if err := os.WriteFile("out/result.json", append(enc, '\n'), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w06.go b/experiments/token-efficiency-heldout-v2/solutions/go/w06.go new file mode 100644 index 0000000..30ab74c --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w06.go @@ -0,0 +1,33 @@ +//go:build ignore + +package main + +import ( + "encoding/json" + "os" + "strconv" + "strings" +) + +func main() { + data, err := os.ReadFile("in/ledger.csv") + if err != nil { + panic(err) + } + out := map[string]int{} + for _, line := range strings.Split(string(data), "\n")[1:] { + r := strings.Split(line, ",") + amount, err := strconv.Atoi(r[2]) + if err != nil { + panic(err) + } + out[r[0][:7]] += amount + } + enc, err := json.MarshalIndent(out, "", " ") + if err != nil { + panic(err) + } + if err := os.WriteFile("out/result.json", append(enc, '\n'), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w07.go b/experiments/token-efficiency-heldout-v2/solutions/go/w07.go new file mode 100644 index 0000000..7bc03b0 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w07.go @@ -0,0 +1,34 @@ +//go:build ignore + +package main + +import ( + "fmt" + "os" + "strconv" + "strings" +) + +func main() { + data, err := os.ReadFile("in/lines.csv") + if err != nil { + panic(err) + } + lines := strings.Split(string(data), "\n") + out := []string{lines[0] + ",total"} + for _, line := range lines[1:] { + r := strings.Split(line, ",") + qty, err := strconv.Atoi(r[1]) + if err != nil { + panic(err) + } + unit, err := strconv.Atoi(r[2]) + if err != nil { + panic(err) + } + out = append(out, fmt.Sprintf("%s,%d", line, qty*unit)) + } + if err := os.WriteFile("out/result.csv", []byte(strings.Join(out, "\n")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w08.go b/experiments/token-efficiency-heldout-v2/solutions/go/w08.go new file mode 100644 index 0000000..0ab3d47 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w08.go @@ -0,0 +1,30 @@ +//go:build ignore + +package main + +import ( + "fmt" + "os" + "strings" +) + +func main() { + data, err := os.ReadFile("in/team.csv") + if err != nil { + panic(err) + } + var rows [][]string + width := 0 + for _, line := range strings.Split(string(data), "\n")[1:] { + r := strings.Split(line, ",") + rows = append(rows, r) + width = max(width, len(r[0])) + } + var out []string + for _, r := range rows { + out = append(out, fmt.Sprintf("%-*s | %s", width, r[0], r[1])) + } + if err := os.WriteFile("out/result.txt", []byte(strings.Join(out, "\n")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w09.go b/experiments/token-efficiency-heldout-v2/solutions/go/w09.go new file mode 100644 index 0000000..b26e875 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w09.go @@ -0,0 +1,29 @@ +//go:build ignore + +package main + +import ( + "os" + "sort" + "strconv" + "strings" +) + +func main() { + data, err := os.ReadFile("in/latency.txt") + if err != nil { + panic(err) + } + var values []int + for _, line := range strings.Split(string(data), "\n") { + v, err := strconv.Atoi(line) + if err != nil { + panic(err) + } + values = append(values, v) + } + sort.Ints(values) + if err := os.WriteFile("out/result.txt", []byte(strconv.Itoa(values[len(values)/2])+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w10.go b/experiments/token-efficiency-heldout-v2/solutions/go/w10.go new file mode 100644 index 0000000..a6df479 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w10.go @@ -0,0 +1,28 @@ +//go:build ignore + +package main + +import ( + "fmt" + "os" + "strconv" + "strings" +) + +func main() { + data, err := os.ReadFile("in/seconds.txt") + if err != nil { + panic(err) + } + var out []string + for _, line := range strings.Split(string(data), "\n") { + s, err := strconv.Atoi(line) + if err != nil { + panic(err) + } + out = append(out, fmt.Sprintf("%d:%02d:%02d", s/3600, s%3600/60, s%60)) + } + if err := os.WriteFile("out/result.txt", []byte(strings.Join(out, "\n")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w11.go b/experiments/token-efficiency-heldout-v2/solutions/go/w11.go new file mode 100644 index 0000000..ee78b09 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w11.go @@ -0,0 +1,38 @@ +//go:build ignore + +package main + +import ( + "fmt" + "os" + "sort" + "strconv" + "strings" +) + +func main() { + data, err := os.ReadFile("in/ages.txt") + if err != nil { + panic(err) + } + counts := map[int]int{} + for _, x := range strings.Split(strings.TrimSpace(string(data)), ",") { + v, err := strconv.Atoi(x) + if err != nil { + panic(err) + } + counts[v/10]++ + } + var buckets []int + for b := range counts { + buckets = append(buckets, b) + } + sort.Ints(buckets) + var out []string + for _, b := range buckets { + out = append(out, fmt.Sprintf("%d-%d: %d", b*10, b*10+9, counts[b])) + } + if err := os.WriteFile("out/result.txt", []byte(strings.Join(out, "\n")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w12.go b/experiments/token-efficiency-heldout-v2/solutions/go/w12.go new file mode 100644 index 0000000..0223691 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w12.go @@ -0,0 +1,36 @@ +//go:build ignore + +package main + +import ( + "encoding/json" + "os" + "strconv" + "strings" +) + +func main() { + data, err := os.ReadFile("in/load.txt") + if err != nil { + panic(err) + } + var a []int + for _, x := range strings.Split(strings.TrimSpace(string(data)), ",") { + v, err := strconv.Atoi(x) + if err != nil { + panic(err) + } + a = append(a, v) + } + out := []int{} + for i := 0; i+3 <= len(a); i++ { + out = append(out, (a[i]+a[i+1]+a[i+2])/3) + } + enc, err := json.MarshalIndent(out, "", " ") + if err != nil { + panic(err) + } + if err := os.WriteFile("out/result.json", append(enc, '\n'), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w13.go b/experiments/token-efficiency-heldout-v2/solutions/go/w13.go new file mode 100644 index 0000000..42f2490 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w13.go @@ -0,0 +1,30 @@ +//go:build ignore + +package main + +import ( + "encoding/json" + "os" +) + +func main() { + data, err := os.ReadFile("in/jobs.json") + if err != nil { + panic(err) + } + var jobs []string + if err := json.Unmarshal(data, &jobs); err != nil { + panic(err) + } + out := [][]string{} + for i := 0; i < len(jobs); i += 3 { + out = append(out, jobs[i:min(i+3, len(jobs))]) + } + enc, err := json.MarshalIndent(out, "", " ") + if err != nil { + panic(err) + } + if err := os.WriteFile("out/result.json", append(enc, '\n'), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w14.go b/experiments/token-efficiency-heldout-v2/solutions/go/w14.go new file mode 100644 index 0000000..8670f85 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w14.go @@ -0,0 +1,40 @@ +//go:build ignore + +package main + +import ( + "encoding/json" + "os" +) + +func readList(path string) []string { + data, err := os.ReadFile(path) + if err != nil { + panic(err) + } + var v []string + if err := json.Unmarshal(data, &v); err != nil { + panic(err) + } + return v +} + +func main() { + left, right := readList("in/left.json"), readList("in/right.json") + out := []string{} + for i := 0; i < max(len(left), len(right)); i++ { + if i < len(left) { + out = append(out, left[i]) + } + if i < len(right) { + out = append(out, right[i]) + } + } + enc, err := json.MarshalIndent(out, "", " ") + if err != nil { + panic(err) + } + if err := os.WriteFile("out/result.json", append(enc, '\n'), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w15.go b/experiments/token-efficiency-heldout-v2/solutions/go/w15.go new file mode 100644 index 0000000..7aac672 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w15.go @@ -0,0 +1,38 @@ +//go:build ignore + +package main + +import ( + "encoding/json" + "os" + "strconv" + "strings" +) + +func main() { + data, err := os.ReadFile("in/ring.json") + if err != nil { + panic(err) + } + var ring []string + if err := json.Unmarshal(data, &ring); err != nil { + panic(err) + } + kd, err := os.ReadFile("in/k.txt") + if err != nil { + panic(err) + } + k, err := strconv.Atoi(strings.TrimSpace(string(kd))) + if err != nil { + panic(err) + } + k %= len(ring) + out := append(append([]string{}, ring[k:]...), ring[:k]...) + enc, err := json.MarshalIndent(out, "", " ") + if err != nil { + panic(err) + } + if err := os.WriteFile("out/result.json", append(enc, '\n'), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w16.go b/experiments/token-efficiency-heldout-v2/solutions/go/w16.go new file mode 100644 index 0000000..1c8ff5f --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w16.go @@ -0,0 +1,30 @@ +//go:build ignore + +package main + +import ( + "encoding/json" + "os" +) + +func main() { + data, err := os.ReadFile("in/meter.json") + if err != nil { + panic(err) + } + var m []int + if err := json.Unmarshal(data, &m); err != nil { + panic(err) + } + out := []int{} + for i := 1; i < len(m); i++ { + out = append(out, m[i]-m[i-1]) + } + enc, err := json.MarshalIndent(out, "", " ") + if err != nil { + panic(err) + } + if err := os.WriteFile("out/result.json", append(enc, '\n'), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w17.go b/experiments/token-efficiency-heldout-v2/solutions/go/w17.go new file mode 100644 index 0000000..09bbf2e --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w17.go @@ -0,0 +1,29 @@ +//go:build ignore + +package main + +import ( + "fmt" + "os" + "strings" +) + +func main() { + data, err := os.ReadFile("in/raw.txt") + if err != nil { + panic(err) + } + raw := strings.TrimSpace(string(data)) + var b strings.Builder + for i := 0; i < len(raw); { + j := i + for j < len(raw) && raw[j] == raw[i] { + j++ + } + fmt.Fprintf(&b, "%c%d", raw[i], j-i) + i = j + } + if err := os.WriteFile("out/result.txt", []byte(b.String()+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w18.go b/experiments/token-efficiency-heldout-v2/solutions/go/w18.go new file mode 100644 index 0000000..7e6ddb7 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w18.go @@ -0,0 +1,31 @@ +//go:build ignore + +package main + +import ( + "os" + "strings" + "unicode" +) + +func main() { + data, err := os.ReadFile("in/idents.txt") + if err != nil { + panic(err) + } + lines := strings.Split(string(data), "\n") + for i, line := range lines { + var b strings.Builder + for _, c := range line { + if unicode.IsUpper(c) { + b.WriteRune('_') + c = unicode.ToLower(c) + } + b.WriteRune(c) + } + lines[i] = b.String() + } + if err := os.WriteFile("out/result.txt", []byte(strings.Join(lines, "\n")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w19.go b/experiments/token-efficiency-heldout-v2/solutions/go/w19.go new file mode 100644 index 0000000..6e4dc12 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w19.go @@ -0,0 +1,24 @@ +//go:build ignore + +package main + +import ( + "os" + "strings" +) + +func main() { + data, err := os.ReadFile("in/msg.txt") + if err != nil { + panic(err) + } + out := strings.Map(func(c rune) rune { + if c >= 'a' && c <= 'z' { + return (c-'a'+3)%26 + 'a' + } + return c + }, strings.TrimSpace(string(data))) + if err := os.WriteFile("out/result.txt", []byte(out+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w20.go b/experiments/token-efficiency-heldout-v2/solutions/go/w20.go new file mode 100644 index 0000000..04d9120 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w20.go @@ -0,0 +1,22 @@ +//go:build ignore + +package main + +import ( + "os" + "strings" +) + +func main() { + data, err := os.ReadFile("in/cards.txt") + if err != nil { + panic(err) + } + lines := strings.Split(string(data), "\n") + for i, line := range lines { + lines[i] = strings.Repeat("*", len(line)-4) + line[len(line)-4:] + } + if err := os.WriteFile("out/result.txt", []byte(strings.Join(lines, "\n")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w21.go b/experiments/token-efficiency-heldout-v2/solutions/go/w21.go new file mode 100644 index 0000000..649fdfb --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w21.go @@ -0,0 +1,32 @@ +//go:build ignore + +package main + +import ( + "encoding/json" + "os" +) + +func main() { + data, err := os.ReadFile("in/staff.json") + if err != nil { + panic(err) + } + var staff []struct{ Name, Manager string } + if err := json.Unmarshal(data, &staff); err != nil { + panic(err) + } + out := map[string][]string{} + for _, s := range staff { + if s.Manager != "" { + out[s.Manager] = append(out[s.Manager], s.Name) + } + } + enc, err := json.MarshalIndent(out, "", " ") + if err != nil { + panic(err) + } + if err := os.WriteFile("out/result.json", append(enc, '\n'), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w22.go b/experiments/token-efficiency-heldout-v2/solutions/go/w22.go new file mode 100644 index 0000000..8d13282 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w22.go @@ -0,0 +1,41 @@ +//go:build ignore + +package main + +import ( + "encoding/json" + "fmt" + "os" + "strings" +) + +func readJSON(path string, v any) { + data, err := os.ReadFile(path) + if err != nil { + panic(err) + } + if err := json.Unmarshal(data, v); err != nil { + panic(err) + } +} + +func main() { + var users []struct { + ID int + Name string + } + var scores []struct{ User, Points int } + readJSON("in/users.json", &users) + readJSON("in/scores.json", &scores) + totals := map[int]int{} + for _, s := range scores { + totals[s.User] += s.Points + } + var out []string + for _, u := range users { + out = append(out, fmt.Sprintf("%s %d", u.Name, totals[u.ID])) + } + if err := os.WriteFile("out/result.txt", []byte(strings.Join(out, "\n")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w23.go b/experiments/token-efficiency-heldout-v2/solutions/go/w23.go new file mode 100644 index 0000000..e316e7d --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w23.go @@ -0,0 +1,38 @@ +//go:build ignore + +package main + +import ( + "encoding/json" + "os" +) + +func readJSON(path string, v any) { + data, err := os.ReadFile(path) + if err != nil { + panic(err) + } + if err := json.Unmarshal(data, v); err != nil { + panic(err) + } +} + +func main() { + var stock map[string]int + var moves []struct { + SKU string + Delta int + } + readJSON("in/stock.json", &stock) + readJSON("in/moves.json", &moves) + for _, m := range moves { + stock[m.SKU] += m.Delta + } + enc, err := json.MarshalIndent(stock, "", " ") + if err != nil { + panic(err) + } + if err := os.WriteFile("out/result.json", append(enc, '\n'), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w24.go b/experiments/token-efficiency-heldout-v2/solutions/go/w24.go new file mode 100644 index 0000000..dfd96e6 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w24.go @@ -0,0 +1,37 @@ +//go:build ignore + +package main + +import ( + "encoding/json" + "os" +) + +func main() { + data, err := os.ReadFile("in/carts.json") + if err != nil { + panic(err) + } + var carts []struct { + Items []struct { + SKU string + Qty int + } + } + if err := json.Unmarshal(data, &carts); err != nil { + panic(err) + } + out := map[string]int{} + for _, c := range carts { + for _, item := range c.Items { + out[item.SKU] += item.Qty + } + } + enc, err := json.MarshalIndent(out, "", " ") + if err != nil { + panic(err) + } + if err := os.WriteFile("out/result.json", append(enc, '\n'), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w25.go b/experiments/token-efficiency-heldout-v2/solutions/go/w25.go new file mode 100644 index 0000000..07912f6 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w25.go @@ -0,0 +1,36 @@ +//go:build ignore + +package main + +import ( + "os" + "strconv" + "strings" +) + +func main() { + data, err := os.ReadFile("in/n.txt") + if err != nil { + panic(err) + } + n, err := strconv.Atoi(strings.TrimSpace(string(data))) + if err != nil { + panic(err) + } + var out []string + for p := 2; p <= n; p++ { + prime := true + for d := 2; d*d <= p; d++ { + if p%d == 0 { + prime = false + break + } + } + if prime { + out = append(out, strconv.Itoa(p)) + } + } + if err := os.WriteFile("out/result.txt", []byte(strings.Join(out, " ")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w26.go b/experiments/token-efficiency-heldout-v2/solutions/go/w26.go new file mode 100644 index 0000000..46d307b --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w26.go @@ -0,0 +1,32 @@ +//go:build ignore + +package main + +import ( + "os" + "strconv" + "strings" +) + +func main() { + data, err := os.ReadFile("in/n.txt") + if err != nil { + panic(err) + } + n, err := strconv.Atoi(strings.TrimSpace(string(data))) + if err != nil { + panic(err) + } + steps := 0 + for n != 1 { + if n%2 == 0 { + n /= 2 + } else { + n = 3*n + 1 + } + steps++ + } + if err := os.WriteFile("out/result.txt", []byte(strconv.Itoa(steps)+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w27.go b/experiments/token-efficiency-heldout-v2/solutions/go/w27.go new file mode 100644 index 0000000..6ae209b --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w27.go @@ -0,0 +1,31 @@ +//go:build ignore + +package main + +import ( + "os" + "strconv" + "strings" +) + +func main() { + data, err := os.ReadFile("in/years.txt") + if err != nil { + panic(err) + } + var out []string + for _, line := range strings.Split(string(data), "\n") { + y, err := strconv.Atoi(line) + if err != nil { + panic(err) + } + kind := "common" + if y%4 == 0 && (y%100 != 0 || y%400 == 0) { + kind = "leap" + } + out = append(out, line+" "+kind) + } + if err := os.WriteFile("out/result.txt", []byte(strings.Join(out, "\n")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w28.go b/experiments/token-efficiency-heldout-v2/solutions/go/w28.go new file mode 100644 index 0000000..6427024 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w28.go @@ -0,0 +1,36 @@ +//go:build ignore + +package main + +import ( + "fmt" + "os" + "strings" +) + +func main() { + data, err := os.ReadFile("in/cmds.txt") + if err != nil { + panic(err) + } + moves := map[[2]string]string{ + {"closed", "open"}: "opened", {"opened", "close"}: "closed", + {"closed", "lock"}: "locked", {"locked", "unlock"}: "closed", + } + state := "closed" + result := "" + for i, cmd := range strings.Split(string(data), "\n") { + next, ok := moves[[2]string{state, cmd}] + if !ok { + result = fmt.Sprintf("error line %d: cannot %s when %s", i+1, cmd, state) + break + } + state = next + } + if result == "" { + result = state + } + if err := os.WriteFile("out/result.txt", []byte(result+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w29.go b/experiments/token-efficiency-heldout-v2/solutions/go/w29.go new file mode 100644 index 0000000..d991f2f --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w29.go @@ -0,0 +1,41 @@ +//go:build ignore + +package main + +import ( + "fmt" + "os" + "strconv" + "strings" +) + +func main() { + bd, err := os.ReadFile("in/budget.txt") + if err != nil { + panic(err) + } + budget, err := strconv.Atoi(strings.TrimSpace(string(bd))) + if err != nil { + panic(err) + } + data, err := os.ReadFile("in/spend.txt") + if err != nil { + panic(err) + } + result := "within budget" + total := 0 + for i, line := range strings.Split(string(data), "\n") { + v, err := strconv.Atoi(line) + if err != nil { + panic(err) + } + total += v + if total > budget { + result = fmt.Sprintf("over at %d", i+1) + break + } + } + if err := os.WriteFile("out/result.txt", []byte(result+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w30.go b/experiments/token-efficiency-heldout-v2/solutions/go/w30.go new file mode 100644 index 0000000..d882350 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w30.go @@ -0,0 +1,37 @@ +//go:build ignore + +package main + +import ( + "encoding/json" + "os" + "strings" +) + +func main() { + data, err := os.ReadFile("in/romans.txt") + if err != nil { + panic(err) + } + values := map[byte]int{'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000} + out := []int{} + for _, line := range strings.Split(string(data), "\n") { + total := 0 + for i := 0; i < len(line); i++ { + d := values[line[i]] + if i+1 < len(line) && d < values[line[i+1]] { + total -= d + } else { + total += d + } + } + out = append(out, total) + } + enc, err := json.MarshalIndent(out, "", " ") + if err != nil { + panic(err) + } + if err := os.WriteFile("out/result.json", append(enc, '\n'), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w31.go b/experiments/token-efficiency-heldout-v2/solutions/go/w31.go new file mode 100644 index 0000000..294fc51 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w31.go @@ -0,0 +1,27 @@ +//go:build ignore + +package main + +import ( + "os" + "strconv" + "strings" +) + +func main() { + data, err := os.ReadFile("in/nums.txt") + if err != nil { + panic(err) + } + var out []string + for _, line := range strings.Split(string(data), "\n") { + n, err := strconv.ParseInt(line, 10, 64) + if err != nil { + panic(err) + } + out = append(out, strconv.FormatInt(n, 2)) + } + if err := os.WriteFile("out/result.txt", []byte(strings.Join(out, "\n")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w32.go b/experiments/token-efficiency-heldout-v2/solutions/go/w32.go new file mode 100644 index 0000000..8b7c682 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w32.go @@ -0,0 +1,41 @@ +//go:build ignore + +package main + +import ( + "os" + "strings" +) + +func luhn(digits string) bool { + total := 0 + for i := 0; i < len(digits); i++ { + d := int(digits[len(digits)-1-i] - '0') + if i%2 == 1 { + d *= 2 + } + if d > 9 { + d -= 9 + } + total += d + } + return total%10 == 0 +} + +func main() { + data, err := os.ReadFile("in/ids.txt") + if err != nil { + panic(err) + } + var out []string + for _, line := range strings.Split(string(data), "\n") { + if luhn(line) { + out = append(out, line+" valid") + } else { + out = append(out, line+" invalid") + } + } + if err := os.WriteFile("out/result.txt", []byte(strings.Join(out, "\n")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w33.go b/experiments/token-efficiency-heldout-v2/solutions/go/w33.go new file mode 100644 index 0000000..8952fbc --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w33.go @@ -0,0 +1,42 @@ +//go:build ignore + +package main + +import ( + "encoding/json" + "fmt" + "os" + "sort" + "strings" +) + +func main() { + data, err := os.ReadFile("in/board.json") + if err != nil { + panic(err) + } + var board []struct { + Name string + Score int + } + if err := json.Unmarshal(data, &board); err != nil { + panic(err) + } + sort.Slice(board, func(i, j int) bool { + if board[i].Score != board[j].Score { + return board[i].Score > board[j].Score + } + return board[i].Name < board[j].Name + }) + var out []string + rank := 0 + for i, e := range board { + if i == 0 || e.Score != board[i-1].Score { + rank++ + } + out = append(out, fmt.Sprintf("%d %s %d", rank, e.Name, e.Score)) + } + if err := os.WriteFile("out/result.txt", []byte(strings.Join(out, "\n")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w34.go b/experiments/token-efficiency-heldout-v2/solutions/go/w34.go new file mode 100644 index 0000000..d8d112d --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w34.go @@ -0,0 +1,33 @@ +//go:build ignore + +package main + +import ( + "fmt" + "os" + "strings" +) + +func main() { + data, err := os.ReadFile("in/maze.txt") + if err != nil { + panic(err) + } + grid := strings.Split(string(data), "\n") + r, c := 0, 0 + for i, row := range grid { + if j := strings.IndexByte(row, 'S'); j >= 0 { + r, c = i, j + } + } + walls := 0 + for _, d := range [][2]int{{-1, 0}, {1, 0}, {0, -1}, {0, 1}} { + y, x := r+d[0], c+d[1] + if y >= 0 && y < len(grid) && x >= 0 && x < len(grid[y]) && grid[y][x] == '#' { + walls++ + } + } + if err := os.WriteFile("out/result.txt", []byte(fmt.Sprintf("%d,%d %d\n", r, c, walls)), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w35.go b/experiments/token-efficiency-heldout-v2/solutions/go/w35.go new file mode 100644 index 0000000..29de44a --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w35.go @@ -0,0 +1,43 @@ +//go:build ignore + +package main + +import ( + "encoding/json" + "fmt" + "os" + "strconv" + "strings" +) + +func main() { + data, err := os.ReadFile("in/prices.json") + if err != nil { + panic(err) + } + var prices []int + if err := json.Unmarshal(data, &prices); err != nil { + panic(err) + } + td, err := os.ReadFile("in/target.txt") + if err != nil { + panic(err) + } + target, err := strconv.Atoi(strings.TrimSpace(string(td))) + if err != nil { + panic(err) + } + result := "none" +search: + for j := 1; j < len(prices); j++ { + for i := 0; i < j; i++ { + if prices[i]+prices[j] == target { + result = fmt.Sprintf("%d %d", i, j) + break search + } + } + } + if err := os.WriteFile("out/result.txt", []byte(result+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w36.go b/experiments/token-efficiency-heldout-v2/solutions/go/w36.go new file mode 100644 index 0000000..df27481 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w36.go @@ -0,0 +1,34 @@ +//go:build ignore + +package main + +import ( + "os" + "strings" +) + +func check(p string) string { + switch { + case len(p) < 8: + return "too short" + case !strings.ContainsAny(p, "0123456789"): + return "no digit" + case !strings.ContainsAny(p, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"): + return "no upper" + } + return "ok" +} + +func main() { + data, err := os.ReadFile("in/passwords.txt") + if err != nil { + panic(err) + } + var out []string + for _, p := range strings.Split(string(data), "\n") { + out = append(out, check(p)) + } + if err := os.WriteFile("out/result.txt", []byte(strings.Join(out, "\n")+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/go/w37.go b/experiments/token-efficiency-heldout-v2/solutions/go/w37.go new file mode 100644 index 0000000..02ed096 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/go/w37.go @@ -0,0 +1,28 @@ +//go:build ignore + +package main + +import ( + "os" + "strings" +) + +func main() { + data, err := os.ReadFile("in/board.txt") + if err != nil { + panic(err) + } + b := strings.ReplaceAll(string(data), "\n", "") + result := "draw" + if strings.Contains(b, ".") { + result = "open" + } + for _, l := range [][3]int{{0, 1, 2}, {3, 4, 5}, {6, 7, 8}, {0, 3, 6}, {1, 4, 7}, {2, 5, 8}, {0, 4, 8}, {2, 4, 6}} { + if b[l[0]] != '.' && b[l[0]] == b[l[1]] && b[l[1]] == b[l[2]] { + result = string(b[l[0]]) + } + } + if err := os.WriteFile("out/result.txt", []byte(result+"\n"), 0o644); err != nil { + panic(err) + } +} diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w01.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w01.howl new file mode 100644 index 0000000..ed9bad3 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w01.howl @@ -0,0 +1,9 @@ +(do + (let (out (list) cur "") + (do + (for w (str_split (str_trim (read_text "in/para.txt")) " ") + (if (= cur "") (set cur w) + (if (<= (str_len (str cur " " w)) 20) (set cur (str cur " " w)) + (do (append out cur) (set cur w))))) + (append out cur) + (write_file "out/result.txt" (str_join out "\n"))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w02.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w02.howl new file mode 100644 index 0000000..ccb142e --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w02.howl @@ -0,0 +1,6 @@ +(do + (let (out (list)) + (do + (for l (lines (read_file "in/events.txt")) + (when (or (= (list_len out) 0) (!= l (list_get out (- (list_len out) 1)))) (append out l))) + (write_file "out/result.txt" (str_join out "\n"))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w03.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w03.howl new file mode 100644 index 0000000..d8090ca --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w03.howl @@ -0,0 +1,9 @@ +(do + (let (out (list)) + (do + (for l (lines (read_file "in/settings.txt")) + (let (s (list_get (str_split l "#") 0)) + (do + (while (ends_with s " ") (set s (str_slice s 0 (- (str_len s) 1)))) + (when (!= s "") (append out s))))) + (write_file "out/result.txt" (str_join out "\n"))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w04.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w04.howl new file mode 100644 index 0000000..e766c76 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w04.howl @@ -0,0 +1 @@ +(do (write_file "out/result.txt" (str_join (map_list l (lines (read_file "in/headings.txt")) (str_join (map_list w (str_split l " ") (str (to_upper (str_slice w 0 1)) (str_slice w 1))) " ")) "\n"))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w05.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w05.howl new file mode 100644 index 0000000..c6c468b --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w05.howl @@ -0,0 +1,6 @@ +(do + (let (out (dict)) + (do + (for l (list_slice (lines (read_file "in/ledger.csv")) 1) + (let (r (str_split l ",")) (map_set out (list_get r 1) (+ (nz (map_get out (list_get r 1)) 0) (to_int (list_get r 2)))))) + (write_file "out/result.json" (encode_json out))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w06.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w06.howl new file mode 100644 index 0000000..c9fa56f --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w06.howl @@ -0,0 +1,6 @@ +(do + (let (out (dict)) + (do + (for l (list_slice (lines (read_file "in/ledger.csv")) 1) + (let (r (str_split l ",") m (str_slice l 0 7)) (map_set out m (+ (nz (map_get out m) 0) (to_int (list_get r 2)))))) + (write_file "out/result.json" (encode_json out))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w07.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w07.howl new file mode 100644 index 0000000..335b464 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w07.howl @@ -0,0 +1,6 @@ +(do + (let (ls (lines (read_file "in/lines.csv")) out (list (str (list_get ls 0) ",total"))) + (do + (for l (list_slice ls 1) + (let (r (str_split l ",")) (append out (str l "," (* (to_int (list_get r 1)) (to_int (list_get r 2))))))) + (write_file "out/result.csv" (str_join out "\n"))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w08.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w08.howl new file mode 100644 index 0000000..8fe9c50 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w08.howl @@ -0,0 +1,9 @@ +(do + (let (rows (map_list l (list_slice (lines (read_file "in/team.csv")) 1) (str_split l ",")) w (max (map_list r rows (str_len (list_get r 0)))) out (list)) + (do + (for r rows + (let (n (list_get r 0)) + (do + (while (< (str_len n) w) (set n (str n " "))) + (append out (str n " | " (list_get r 1)))))) + (write_file "out/result.txt" (str_join out "\n"))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w09.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w09.howl new file mode 100644 index 0000000..917c38b --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w09.howl @@ -0,0 +1 @@ +(do (let (v (sort (map_list x (lines (read_file "in/latency.txt")) (to_int x)))) (write_file "out/result.txt" (to_string (list_get v (to_int (/ (list_len v) 2))))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w10.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w10.howl new file mode 100644 index 0000000..8336c92 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w10.howl @@ -0,0 +1,7 @@ +(do + (write_file "out/result.txt" + (str_join + (map_list x (lines (read_file "in/seconds.txt")) + (let (s (to_int x) h (to_int (/ s 3600)) m (to_int (/ (- s (* h 3600)) 60)) c (- (- s (* h 3600)) (* m 60))) + (str h ":" (if (< m 10) "0" "") m ":" (if (< c 10) "0" "") c))) + "\n"))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w11.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w11.howl new file mode 100644 index 0000000..0897997 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w11.howl @@ -0,0 +1,9 @@ +(do + (let (a (map_list x (str_split (str_trim (read_text "in/ages.txt")) ",") (to_int x)) out (list) b 0) + (do + (while (<= (* b 10) (max a)) + (do + (let (c (list_len (filter x a (= (to_int (/ x 10)) b)))) + (when (> c 0) (append out (str (* b 10) "-" (+ (* b 10) 9) ": " c)))) + (inc b))) + (write_file "out/result.txt" (str_join out "\n"))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w12.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w12.howl new file mode 100644 index 0000000..c7c3e91 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w12.howl @@ -0,0 +1,6 @@ +(do + (let (a (map_list x (str_split (str_trim (read_text "in/load.txt")) ",") (to_int x)) out (list) i 0) + (do + (while (<= (+ i 3) (list_len a)) + (do (append out (to_int (/ (sum (list_slice a i (+ i 3))) 3))) (inc i))) + (write_file "out/result.json" (encode_json out))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w13.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w13.howl new file mode 100644 index 0000000..dfa4f47 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w13.howl @@ -0,0 +1,6 @@ +(do + (let (q (parse_json Any (read_text "in/jobs.json")) out (list) i 0) + (do + (while (< i (list_len q)) + (do (append out (list_slice q i (+ i 3))) (set i (+ i 3)))) + (write_file "out/result.json" (encode_json out))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w14.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w14.howl new file mode 100644 index 0000000..6471ca5 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w14.howl @@ -0,0 +1,9 @@ +(do + (let (a (parse_json Any (read_text "in/left.json")) b (parse_json Any (read_text "in/right.json")) out (list) i 0) + (do + (while (< i (max (list (list_len a) (list_len b)))) + (do + (when (< i (list_len a)) (append out (list_get a i))) + (when (< i (list_len b)) (append out (list_get b i))) + (inc i))) + (write_file "out/result.json" (encode_json out))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w15.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w15.howl new file mode 100644 index 0000000..bc1bf3e --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w15.howl @@ -0,0 +1,5 @@ +(do + (let (r (parse_json Any (read_text "in/ring.json")) n (list_len r) k (to_int (str_trim (read_text "in/k.txt"))) k (- k (* n (to_int (/ k n)))) out (list_slice r k)) + (do + (for x (list_slice r 0 k) (append out x)) + (write_file "out/result.json" (encode_json out))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w16.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w16.howl new file mode 100644 index 0000000..5834d1a --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w16.howl @@ -0,0 +1,6 @@ +(do + (let (m (parse_json Any (read_text "in/meter.json")) out (list) i 1) + (do + (while (< i (list_len m)) + (do (append out (- (list_get m i) (list_get m (- i 1)))) (inc i))) + (write_file "out/result.json" (encode_json out))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w17.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w17.howl new file mode 100644 index 0000000..2ffbe32 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w17.howl @@ -0,0 +1,7 @@ +(do + (let (out "" prev "" n 0) + (do + (for c (str_split (str_trim (read_text "in/raw.txt")) "") + (if (= c prev) (inc n) + (do (when (> n 0) (set out (str out prev n))) (set prev c) (set n 1)))) + (write_file "out/result.txt" (str out prev n))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w18.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w18.howl new file mode 100644 index 0000000..099d86d --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w18.howl @@ -0,0 +1 @@ +(do (write_file "out/result.txt" (str_join (map_list l (lines (read_file "in/idents.txt")) (str_join (map_list c (str_split l "") (if (!= c (to_lower c)) (str "_" (to_lower c)) c)) "")) "\n"))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w19.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w19.howl new file mode 100644 index 0000000..c5a205a --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w19.howl @@ -0,0 +1,7 @@ +(do + (let (abc (str_split "abcdefghijklmnopqrstuvwxyz" "")) + (write_file "out/result.txt" + (str_join + (map_list c (str_split (str_trim (read_text "in/msg.txt")) "") + (let (i (index_of abc c)) (if (< i 0) c (list_get abc (if (> i 22) (- i 23) (+ i 3)))))) + "")))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w20.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w20.howl new file mode 100644 index 0000000..c3a80ac --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w20.howl @@ -0,0 +1,6 @@ +(do + (write_file "out/result.txt" + (str_join + (map_list l (lines (read_file "in/cards.txt")) + (let (k (- (str_len l) 4)) (str (str_join (map_list c (str_split (str_slice l 0 k) "") "*") "") (str_slice l k)))) + "\n"))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w21.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w21.howl new file mode 100644 index 0000000..abc590a --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w21.howl @@ -0,0 +1,8 @@ +(do + (let (out (dict)) + (do + (for s (parse_json Any (read_text "in/staff.json")) + (let (m (map_get s "manager")) + (when (!= m "") + (let (r (nz (map_get out m) (list))) (do (append r (map_get s "name")) (map_set out m r)))))) + (write_file "out/result.json" (encode_json out))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w22.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w22.howl new file mode 100644 index 0000000..9d2e084 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w22.howl @@ -0,0 +1,7 @@ +(do + (let (sc (parse_json Any (read_text "in/scores.json"))) + (write_file "out/result.txt" + (str_join + (map_list u (parse_json Any (read_text "in/users.json")) + (str (map_get u "name") " " (sum (map_list s (filter s sc (= (map_get s "user") (map_get u "id"))) (map_get s "points"))))) + "\n")))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w23.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w23.howl new file mode 100644 index 0000000..5b4c85f --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w23.howl @@ -0,0 +1,6 @@ +(do + (let (st (parse_json Any (read_text "in/stock.json"))) + (do + (for m (parse_json Any (read_text "in/moves.json")) + (map_set st (map_get m "sku") (+ (nz (map_get st (map_get m "sku")) 0) (map_get m "delta")))) + (write_file "out/result.json" (encode_json st))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w24.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w24.howl new file mode 100644 index 0000000..e2413dc --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w24.howl @@ -0,0 +1,7 @@ +(do + (let (out (dict)) + (do + (for c (parse_json Any (read_text "in/carts.json")) + (for i (map_get c "items") + (map_set out (map_get i "sku") (+ (nz (map_get out (map_get i "sku")) 0) (map_get i "qty"))))) + (write_file "out/result.json" (encode_json out))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w25.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w25.howl new file mode 100644 index 0000000..f37f55d --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w25.howl @@ -0,0 +1,12 @@ +(do + (let (n (to_int (str_trim (read_text "in/n.txt"))) out (list) p 2) + (do + (while (<= p n) + (do + (let (d 2 ok true) + (do + (while (and ok (<= (* d d) p)) + (do (when (= (* d (to_int (/ p d))) p) (set ok false)) (inc d))) + (when ok (append out p)))) + (inc p))) + (write_file "out/result.txt" (str_join out " "))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w26.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w26.howl new file mode 100644 index 0000000..d9dd5a8 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w26.howl @@ -0,0 +1,6 @@ +(do + (let (n (to_int (str_trim (read_text "in/n.txt"))) k 0) + (do + (while (!= n 1) + (do (set n (if (= (* 2 (to_int (/ n 2))) n) (to_int (/ n 2)) (+ (* 3 n) 1))) (inc k))) + (write_file "out/result.txt" (to_string k))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w27.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w27.howl new file mode 100644 index 0000000..ad9f755 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w27.howl @@ -0,0 +1,7 @@ +(do + (write_file "out/result.txt" + (str_join + (map_list l (lines (read_file "in/years.txt")) + (let (y (to_int l) dv (if (= (* 100 (to_int (/ y 100))) y) 400 4)) + (str y (if (= (* dv (to_int (/ y dv))) y) " leap" " common")))) + "\n"))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w28.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w28.howl new file mode 100644 index 0000000..b7ebad2 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w28.howl @@ -0,0 +1,10 @@ +(do + (let (t (dict ("closed open" "opened") ("opened close" "closed") ("closed lock" "locked") ("locked unlock" "closed")) st "closed" res "" i 0) + (do + (for c (lines (read_file "in/cmds.txt")) + (do + (inc i) + (when (= res "") + (let (nx (map_get t (str st " " c))) + (if (is_nil nx) (set res (str "error line " i ": cannot " c " when " st)) (set st nx)))))) + (write_file "out/result.txt" (if (= res "") st res))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w29.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w29.howl new file mode 100644 index 0000000..f496f29 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w29.howl @@ -0,0 +1,9 @@ +(do + (let (b (to_int (str_trim (read_text "in/budget.txt"))) tot 0 i 0 res "within budget") + (do + (for x (lines (read_file "in/spend.txt")) + (do + (inc i) + (set tot (+ tot (to_int x))) + (when (and (> tot b) (= res "within budget")) (set res (str "over at " i))))) + (write_file "out/result.txt" res)))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w30.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w30.howl new file mode 100644 index 0000000..14d61cd --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w30.howl @@ -0,0 +1,12 @@ +(do + (let (v (dict ("I" 1) ("V" 5) ("X" 10) ("L" 50) ("C" 100) ("D" 500) ("M" 1000))) + (write_file "out/result.json" + (encode_json + (map_list l (lines (read_file "in/romans.txt")) + (let (ds (map_list c (str_split l "") (map_get v c)) t 0 i 0) + (do + (for d ds + (do + (inc i) + (set t (if (and (< i (list_len ds)) (< d (list_get ds i))) (- t d) (+ t d))))) + t))))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w31.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w31.howl new file mode 100644 index 0000000..ebe926b --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w31.howl @@ -0,0 +1,10 @@ +(do + (write_file "out/result.txt" + (str_join + (map_list l (lines (read_file "in/nums.txt")) + (let (n (to_int l) s "") + (do + (while (> n 0) + (do (set s (str (- n (* 2 (to_int (/ n 2)))) s)) (set n (to_int (/ n 2))))) + (if (= s "") "0" s)))) + "\n"))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w32.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w32.howl new file mode 100644 index 0000000..a14fd7c --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w32.howl @@ -0,0 +1,11 @@ +(do + (write_file "out/result.txt" + (str_join + (map_list l (lines (read_file "in/ids.txt")) + (let (t 0 i 0) + (do + (for c (reverse (str_split l "")) + (let (d (* (to_int c) (+ 1 (- i (* 2 (to_int (/ i 2))))))) + (do (set t (+ t (if (> d 9) (- d 9) d))) (inc i)))) + (str l (if (= (* 10 (to_int (/ t 10))) t) " valid" " invalid"))))) + "\n"))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w33.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w33.howl new file mode 100644 index 0000000..d79837d --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w33.howl @@ -0,0 +1,9 @@ +(do + (let (b (parse_json Any (read_text "in/board.json")) ss (list) out (list)) + (do + (for s (reverse (sort (map_list e b (map_get e "score")))) + (when (not (list_contains ss s)) (append ss s))) + (for s ss + (for n (sort (map_list e (filter e b (= (map_get e "score") s)) (map_get e "name"))) + (append out (str (+ (index_of ss s) 1) " " n " " s)))) + (write_file "out/result.txt" (str_join out "\n"))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w34.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w34.howl new file mode 100644 index 0000000..503ad4e --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w34.howl @@ -0,0 +1,10 @@ +(do + (let (g (map_list l (lines (read_file "in/maze.txt")) (str_split l "")) r 0 c 0 w 0 i 0) + (do + (for row g + (do (when (list_contains row "S") (do (set r i) (set c (index_of row "S")))) (inc i))) + (for d (list (list (- 0 1) 0) (list 1 0) (list 0 (- 0 1)) (list 0 1)) + (let (y (+ r (list_get d 0)) x (+ c (list_get d 1))) + (when (and (and (>= y 0) (< y (list_len g))) (and (>= x 0) (< x (list_len (list_get g y))))) + (when (= (list_get (list_get g y) x) "#") (inc w))))) + (write_file "out/result.txt" (str r "," c " " w))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w35.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w35.howl new file mode 100644 index 0000000..f4f673e --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w35.howl @@ -0,0 +1,10 @@ +(do + (let (p (parse_json Any (read_text "in/prices.json")) t (to_int (str_trim (read_text "in/target.txt"))) res "none" j 1) + (do + (while (and (= res "none") (< j (list_len p))) + (let (i 0) + (do + (while (and (= res "none") (< i j)) + (do (when (= (+ (list_get p i) (list_get p j)) t) (set res (str i " " j))) (inc i))) + (inc j)))) + (write_file "out/result.txt" res)))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w36.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w36.howl new file mode 100644 index 0000000..6541474 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w36.howl @@ -0,0 +1,9 @@ +(do + (write_file "out/result.txt" + (str_join + (map_list l (lines (read_file "in/passwords.txt")) + (let (cs (str_split l "")) + (if (< (str_len l) 8) "too short" + (if (not (any c cs (str_contains "0123456789" c))) "no digit" + (if (not (any c cs (str_contains "ABCDEFGHIJKLMNOPQRSTUVWXYZ" c))) "no upper" "ok"))))) + "\n"))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/howl/w37.howl b/experiments/token-efficiency-heldout-v2/solutions/howl/w37.howl new file mode 100644 index 0000000..7e85d56 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/howl/w37.howl @@ -0,0 +1,7 @@ +(do + (let (b (str_split (str_join (lines (read_file "in/board.txt")) "") "") res "") + (do + (for t (list (list 0 1 2) (list 3 4 5) (list 6 7 8) (list 0 3 6) (list 1 4 7) (list 2 5 8) (list 0 4 8) (list 2 4 6)) + (let (a (list_get b (list_get t 0))) + (when (and (!= a ".") (and (= a (list_get b (list_get t 1))) (= a (list_get b (list_get t 2))))) (set res a)))) + (write_file "out/result.txt" (if (!= res "") res (if (list_contains b ".") "open" "draw")))))) diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w01.js b/experiments/token-efficiency-heldout-v2/solutions/js/w01.js new file mode 100644 index 0000000..bd4bfe1 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w01.js @@ -0,0 +1,14 @@ +const fs = require("fs"); + +const out = []; +let cur = ""; +for (const word of fs.readFileSync("in/para.txt", "utf8").trim().split(" ")) { + if (!cur) cur = word; + else if (cur.length + 1 + word.length <= 20) cur += " " + word; + else { + out.push(cur); + cur = word; + } +} +out.push(cur); +fs.writeFileSync("out/result.txt", out.join("\n") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w02.js b/experiments/token-efficiency-heldout-v2/solutions/js/w02.js new file mode 100644 index 0000000..159c32f --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w02.js @@ -0,0 +1,4 @@ +const fs = require("fs"); + +const lines = fs.readFileSync("in/events.txt", "utf8").split("\n"); +fs.writeFileSync("out/result.txt", lines.filter((line, i) => i === 0 || line !== lines[i - 1]).join("\n") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w03.js b/experiments/token-efficiency-heldout-v2/solutions/js/w03.js new file mode 100644 index 0000000..6a25f93 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w03.js @@ -0,0 +1,4 @@ +const fs = require("fs"); + +const lines = fs.readFileSync("in/settings.txt", "utf8").split("\n").map((line) => line.split("#")[0].replace(/ +$/, "")); +fs.writeFileSync("out/result.txt", lines.filter((line) => line).join("\n") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w04.js b/experiments/token-efficiency-heldout-v2/solutions/js/w04.js new file mode 100644 index 0000000..993683b --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w04.js @@ -0,0 +1,5 @@ +const fs = require("fs"); + +const lines = fs.readFileSync("in/headings.txt", "utf8").split("\n"); +const title = (line) => line.split(" ").map((w) => w.slice(0, 1).toUpperCase() + w.slice(1)).join(" "); +fs.writeFileSync("out/result.txt", lines.map(title).join("\n") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w05.js b/experiments/token-efficiency-heldout-v2/solutions/js/w05.js new file mode 100644 index 0000000..f3eaec6 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w05.js @@ -0,0 +1,8 @@ +const fs = require("fs"); + +const out = {}; +for (const line of fs.readFileSync("in/ledger.csv", "utf8").split("\n").slice(1)) { + const [, account, amount] = line.split(","); + out[account] = (out[account] || 0) + Number(amount); +} +fs.writeFileSync("out/result.json", JSON.stringify(out, null, 2) + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w06.js b/experiments/token-efficiency-heldout-v2/solutions/js/w06.js new file mode 100644 index 0000000..b045675 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w06.js @@ -0,0 +1,9 @@ +const fs = require("fs"); + +const out = {}; +for (const line of fs.readFileSync("in/ledger.csv", "utf8").split("\n").slice(1)) { + const [date, , amount] = line.split(","); + const month = date.slice(0, 7); + out[month] = (out[month] || 0) + Number(amount); +} +fs.writeFileSync("out/result.json", JSON.stringify(out, null, 2) + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w07.js b/experiments/token-efficiency-heldout-v2/solutions/js/w07.js new file mode 100644 index 0000000..5c3f84a --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w07.js @@ -0,0 +1,9 @@ +const fs = require("fs"); + +const [header, ...rows] = fs.readFileSync("in/lines.csv", "utf8").split("\n"); +const out = [header + ",total"]; +for (const line of rows) { + const [, qty, unit] = line.split(","); + out.push(`${line},${Number(qty) * Number(unit)}`); +} +fs.writeFileSync("out/result.csv", out.join("\n") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w08.js b/experiments/token-efficiency-heldout-v2/solutions/js/w08.js new file mode 100644 index 0000000..8115188 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w08.js @@ -0,0 +1,5 @@ +const fs = require("fs"); + +const rows = fs.readFileSync("in/team.csv", "utf8").split("\n").slice(1).map((line) => line.split(",")); +const width = Math.max(...rows.map(([name]) => name.length)); +fs.writeFileSync("out/result.txt", rows.map(([name, role]) => `${name.padEnd(width)} | ${role}`).join("\n") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w09.js b/experiments/token-efficiency-heldout-v2/solutions/js/w09.js new file mode 100644 index 0000000..9d4fc46 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w09.js @@ -0,0 +1,4 @@ +const fs = require("fs"); + +const values = fs.readFileSync("in/latency.txt", "utf8").split("\n").map(Number).sort((a, b) => a - b); +fs.writeFileSync("out/result.txt", values[Math.floor(values.length / 2)] + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w10.js b/experiments/token-efficiency-heldout-v2/solutions/js/w10.js new file mode 100644 index 0000000..92837c7 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w10.js @@ -0,0 +1,8 @@ +const fs = require("fs"); + +const pad = (n) => String(n).padStart(2, "0"); +const out = fs.readFileSync("in/seconds.txt", "utf8").split("\n").map((x) => { + const s = Number(x); + return `${Math.floor(s / 3600)}:${pad(Math.floor((s % 3600) / 60))}:${pad(s % 60)}`; +}); +fs.writeFileSync("out/result.txt", out.join("\n") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w11.js b/experiments/token-efficiency-heldout-v2/solutions/js/w11.js new file mode 100644 index 0000000..bd03089 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w11.js @@ -0,0 +1,9 @@ +const fs = require("fs"); + +const counts = new Map(); +for (const x of fs.readFileSync("in/ages.txt", "utf8").trim().split(",")) { + const b = Math.floor(Number(x) / 10); + counts.set(b, (counts.get(b) || 0) + 1); +} +const out = [...counts.keys()].sort((a, b) => a - b).map((b) => `${b * 10}-${b * 10 + 9}: ${counts.get(b)}`); +fs.writeFileSync("out/result.txt", out.join("\n") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w12.js b/experiments/token-efficiency-heldout-v2/solutions/js/w12.js new file mode 100644 index 0000000..bd7070d --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w12.js @@ -0,0 +1,6 @@ +const fs = require("fs"); + +const a = fs.readFileSync("in/load.txt", "utf8").trim().split(",").map(Number); +const out = []; +for (let i = 0; i + 3 <= a.length; i++) out.push(Math.floor((a[i] + a[i + 1] + a[i + 2]) / 3)); +fs.writeFileSync("out/result.json", JSON.stringify(out, null, 2) + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w13.js b/experiments/token-efficiency-heldout-v2/solutions/js/w13.js new file mode 100644 index 0000000..7b07b19 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w13.js @@ -0,0 +1,6 @@ +const fs = require("fs"); + +const jobs = JSON.parse(fs.readFileSync("in/jobs.json", "utf8")); +const out = []; +for (let i = 0; i < jobs.length; i += 3) out.push(jobs.slice(i, i + 3)); +fs.writeFileSync("out/result.json", JSON.stringify(out, null, 2) + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w14.js b/experiments/token-efficiency-heldout-v2/solutions/js/w14.js new file mode 100644 index 0000000..39246de --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w14.js @@ -0,0 +1,7 @@ +const fs = require("fs"); + +const left = JSON.parse(fs.readFileSync("in/left.json", "utf8")); +const right = JSON.parse(fs.readFileSync("in/right.json", "utf8")); +const out = []; +for (let i = 0; i < Math.max(left.length, right.length); i++) out.push(...left.slice(i, i + 1), ...right.slice(i, i + 1)); +fs.writeFileSync("out/result.json", JSON.stringify(out, null, 2) + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w15.js b/experiments/token-efficiency-heldout-v2/solutions/js/w15.js new file mode 100644 index 0000000..e3b2652 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w15.js @@ -0,0 +1,5 @@ +const fs = require("fs"); + +const ring = JSON.parse(fs.readFileSync("in/ring.json", "utf8")); +const k = Number(fs.readFileSync("in/k.txt", "utf8")) % ring.length; +fs.writeFileSync("out/result.json", JSON.stringify([...ring.slice(k), ...ring.slice(0, k)], null, 2) + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w16.js b/experiments/token-efficiency-heldout-v2/solutions/js/w16.js new file mode 100644 index 0000000..5729e3f --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w16.js @@ -0,0 +1,4 @@ +const fs = require("fs"); + +const m = JSON.parse(fs.readFileSync("in/meter.json", "utf8")); +fs.writeFileSync("out/result.json", JSON.stringify(m.slice(1).map((v, i) => v - m[i]), null, 2) + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w17.js b/experiments/token-efficiency-heldout-v2/solutions/js/w17.js new file mode 100644 index 0000000..723c361 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w17.js @@ -0,0 +1,5 @@ +const fs = require("fs"); + +const raw = fs.readFileSync("in/raw.txt", "utf8").trim(); +const runs = raw.match(/(.)\1*/g); +fs.writeFileSync("out/result.txt", runs.map((r) => r[0] + r.length).join("") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w18.js b/experiments/token-efficiency-heldout-v2/solutions/js/w18.js new file mode 100644 index 0000000..0bd005d --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w18.js @@ -0,0 +1,4 @@ +const fs = require("fs"); + +const lines = fs.readFileSync("in/idents.txt", "utf8").split("\n"); +fs.writeFileSync("out/result.txt", lines.map((line) => line.replace(/[A-Z]/g, (c) => "_" + c.toLowerCase())).join("\n") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w19.js b/experiments/token-efficiency-heldout-v2/solutions/js/w19.js new file mode 100644 index 0000000..48101b5 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w19.js @@ -0,0 +1,5 @@ +const fs = require("fs"); + +const msg = fs.readFileSync("in/msg.txt", "utf8").trim(); +const out = msg.replace(/[a-z]/g, (c) => String.fromCharCode(((c.charCodeAt(0) - 97 + 3) % 26) + 97)); +fs.writeFileSync("out/result.txt", out + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w20.js b/experiments/token-efficiency-heldout-v2/solutions/js/w20.js new file mode 100644 index 0000000..8d6c7a3 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w20.js @@ -0,0 +1,4 @@ +const fs = require("fs"); + +const lines = fs.readFileSync("in/cards.txt", "utf8").split("\n"); +fs.writeFileSync("out/result.txt", lines.map((line) => "*".repeat(line.length - 4) + line.slice(-4)).join("\n") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w21.js b/experiments/token-efficiency-heldout-v2/solutions/js/w21.js new file mode 100644 index 0000000..6947660 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w21.js @@ -0,0 +1,7 @@ +const fs = require("fs"); + +const out = {}; +for (const s of JSON.parse(fs.readFileSync("in/staff.json", "utf8"))) { + if (s.manager) (out[s.manager] ||= []).push(s.name); +} +fs.writeFileSync("out/result.json", JSON.stringify(out, null, 2) + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w22.js b/experiments/token-efficiency-heldout-v2/solutions/js/w22.js new file mode 100644 index 0000000..734e090 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w22.js @@ -0,0 +1,6 @@ +const fs = require("fs"); + +const users = JSON.parse(fs.readFileSync("in/users.json", "utf8")); +const scores = JSON.parse(fs.readFileSync("in/scores.json", "utf8")); +const total = (id) => scores.filter((s) => s.user === id).reduce((a, s) => a + s.points, 0); +fs.writeFileSync("out/result.txt", users.map((u) => `${u.name} ${total(u.id)}`).join("\n") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w23.js b/experiments/token-efficiency-heldout-v2/solutions/js/w23.js new file mode 100644 index 0000000..92e48a2 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w23.js @@ -0,0 +1,5 @@ +const fs = require("fs"); + +const stock = JSON.parse(fs.readFileSync("in/stock.json", "utf8")); +for (const m of JSON.parse(fs.readFileSync("in/moves.json", "utf8"))) stock[m.sku] = (stock[m.sku] || 0) + m.delta; +fs.writeFileSync("out/result.json", JSON.stringify(stock, null, 2) + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w24.js b/experiments/token-efficiency-heldout-v2/solutions/js/w24.js new file mode 100644 index 0000000..5510c45 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w24.js @@ -0,0 +1,7 @@ +const fs = require("fs"); + +const out = {}; +for (const cart of JSON.parse(fs.readFileSync("in/carts.json", "utf8"))) { + for (const item of cart.items) out[item.sku] = (out[item.sku] || 0) + item.qty; +} +fs.writeFileSync("out/result.json", JSON.stringify(out, null, 2) + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w25.js b/experiments/token-efficiency-heldout-v2/solutions/js/w25.js new file mode 100644 index 0000000..0f2e552 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w25.js @@ -0,0 +1,10 @@ +const fs = require("fs"); + +const n = Number(fs.readFileSync("in/n.txt", "utf8")); +const primes = []; +for (let p = 2; p <= n; p++) { + let prime = true; + for (let d = 2; d * d <= p; d++) if (p % d === 0) prime = false; + if (prime) primes.push(p); +} +fs.writeFileSync("out/result.txt", primes.join(" ") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w26.js b/experiments/token-efficiency-heldout-v2/solutions/js/w26.js new file mode 100644 index 0000000..151c834 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w26.js @@ -0,0 +1,9 @@ +const fs = require("fs"); + +let n = Number(fs.readFileSync("in/n.txt", "utf8")); +let steps = 0; +while (n !== 1) { + n = n % 2 === 0 ? n / 2 : 3 * n + 1; + steps++; +} +fs.writeFileSync("out/result.txt", steps + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w27.js b/experiments/token-efficiency-heldout-v2/solutions/js/w27.js new file mode 100644 index 0000000..2acb229 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w27.js @@ -0,0 +1,5 @@ +const fs = require("fs"); + +const lines = fs.readFileSync("in/years.txt", "utf8").split("\n"); +const leap = (y) => y % 4 === 0 && (y % 100 !== 0 || y % 400 === 0); +fs.writeFileSync("out/result.txt", lines.map((y) => `${y} ${leap(Number(y)) ? "leap" : "common"}`).join("\n") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w28.js b/experiments/token-efficiency-heldout-v2/solutions/js/w28.js new file mode 100644 index 0000000..7a97ba1 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w28.js @@ -0,0 +1,15 @@ +const fs = require("fs"); + +const moves = { "closed open": "opened", "opened close": "closed", "closed lock": "locked", "locked unlock": "closed" }; +let state = "closed"; +let result = null; +const cmds = fs.readFileSync("in/cmds.txt", "utf8").split("\n"); +for (let i = 0; i < cmds.length; i++) { + const next = moves[`${state} ${cmds[i]}`]; + if (!next) { + result = `error line ${i + 1}: cannot ${cmds[i]} when ${state}`; + break; + } + state = next; +} +fs.writeFileSync("out/result.txt", (result || state) + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w29.js b/experiments/token-efficiency-heldout-v2/solutions/js/w29.js new file mode 100644 index 0000000..71d40d7 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w29.js @@ -0,0 +1,14 @@ +const fs = require("fs"); + +const budget = Number(fs.readFileSync("in/budget.txt", "utf8")); +const spend = fs.readFileSync("in/spend.txt", "utf8").split("\n").map(Number); +let result = "within budget"; +let total = 0; +for (let i = 0; i < spend.length; i++) { + total += spend[i]; + if (total > budget) { + result = `over at ${i + 1}`; + break; + } +} +fs.writeFileSync("out/result.txt", result + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w30.js b/experiments/token-efficiency-heldout-v2/solutions/js/w30.js new file mode 100644 index 0000000..96b99e3 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w30.js @@ -0,0 +1,8 @@ +const fs = require("fs"); + +const values = { I: 1, V: 5, X: 10, L: 50, C: 100, D: 500, M: 1000 }; +const out = fs.readFileSync("in/romans.txt", "utf8").split("\n").map((line) => { + const ds = [...line].map((c) => values[c]); + return ds.reduce((t, d, i) => (d < (ds[i + 1] || 0) ? t - d : t + d), 0); +}); +fs.writeFileSync("out/result.json", JSON.stringify(out, null, 2) + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w31.js b/experiments/token-efficiency-heldout-v2/solutions/js/w31.js new file mode 100644 index 0000000..8058dc1 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w31.js @@ -0,0 +1,4 @@ +const fs = require("fs"); + +const lines = fs.readFileSync("in/nums.txt", "utf8").split("\n"); +fs.writeFileSync("out/result.txt", lines.map((x) => Number(x).toString(2)).join("\n") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w32.js b/experiments/token-efficiency-heldout-v2/solutions/js/w32.js new file mode 100644 index 0000000..62a5497 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w32.js @@ -0,0 +1,12 @@ +const fs = require("fs"); + +const luhn = (digits) => { + let total = 0; + [...digits].reverse().forEach((c, i) => { + const d = Number(c) * (i % 2 ? 2 : 1); + total += d > 9 ? d - 9 : d; + }); + return total % 10 === 0; +}; +const lines = fs.readFileSync("in/ids.txt", "utf8").split("\n"); +fs.writeFileSync("out/result.txt", lines.map((x) => `${x} ${luhn(x) ? "valid" : "invalid"}`).join("\n") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w33.js b/experiments/token-efficiency-heldout-v2/solutions/js/w33.js new file mode 100644 index 0000000..ccc9913 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w33.js @@ -0,0 +1,6 @@ +const fs = require("fs"); + +const board = JSON.parse(fs.readFileSync("in/board.json", "utf8")); +board.sort((a, b) => b.score - a.score || (a.name < b.name ? -1 : a.name > b.name ? 1 : 0)); +const scores = [...new Set(board.map((e) => e.score))]; +fs.writeFileSync("out/result.txt", board.map((e) => `${scores.indexOf(e.score) + 1} ${e.name} ${e.score}`).join("\n") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w34.js b/experiments/token-efficiency-heldout-v2/solutions/js/w34.js new file mode 100644 index 0000000..41ad1ea --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w34.js @@ -0,0 +1,7 @@ +const fs = require("fs"); + +const grid = fs.readFileSync("in/maze.txt", "utf8").split("\n"); +const r = grid.findIndex((row) => row.includes("S")); +const c = grid[r].indexOf("S"); +const walls = [[r - 1, c], [r + 1, c], [r, c - 1], [r, c + 1]].filter(([y, x]) => grid[y] && grid[y][x] === "#").length; +fs.writeFileSync("out/result.txt", `${r},${c} ${walls}\n`); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w35.js b/experiments/token-efficiency-heldout-v2/solutions/js/w35.js new file mode 100644 index 0000000..f9e84f6 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w35.js @@ -0,0 +1,14 @@ +const fs = require("fs"); + +const prices = JSON.parse(fs.readFileSync("in/prices.json", "utf8")); +const target = Number(fs.readFileSync("in/target.txt", "utf8")); +let result = "none"; +search: for (let j = 1; j < prices.length; j++) { + for (let i = 0; i < j; i++) { + if (prices[i] + prices[j] === target) { + result = `${i} ${j}`; + break search; + } + } +} +fs.writeFileSync("out/result.txt", result + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w36.js b/experiments/token-efficiency-heldout-v2/solutions/js/w36.js new file mode 100644 index 0000000..35faca7 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w36.js @@ -0,0 +1,5 @@ +const fs = require("fs"); + +const check = (p) => (p.length < 8 ? "too short" : !/[0-9]/.test(p) ? "no digit" : !/[A-Z]/.test(p) ? "no upper" : "ok"); +const lines = fs.readFileSync("in/passwords.txt", "utf8").split("\n"); +fs.writeFileSync("out/result.txt", lines.map(check).join("\n") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/js/w37.js b/experiments/token-efficiency-heldout-v2/solutions/js/w37.js new file mode 100644 index 0000000..c1ddcf7 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/js/w37.js @@ -0,0 +1,6 @@ +const fs = require("fs"); + +const b = fs.readFileSync("in/board.txt", "utf8").replace(/\n/g, ""); +const lines = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]]; +const win = lines.find(([i, j, k]) => b[i] !== "." && b[i] === b[j] && b[j] === b[k]); +fs.writeFileSync("out/result.txt", (win ? b[win[0]] : b.includes(".") ? "open" : "draw") + "\n"); diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w01.py b/experiments/token-efficiency-heldout-v2/solutions/python/w01.py new file mode 100644 index 0000000..5be5b90 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w01.py @@ -0,0 +1,13 @@ +from pathlib import Path + +out, cur = [], "" +for word in Path("in/para.txt").read_text().split(): + if not cur: + cur = word + elif len(cur) + 1 + len(word) <= 20: + cur += " " + word + else: + out.append(cur) + cur = word +out.append(cur) +Path("out/result.txt").write_text("\n".join(out) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w02.py b/experiments/token-efficiency-heldout-v2/solutions/python/w02.py new file mode 100644 index 0000000..5d7d91f --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w02.py @@ -0,0 +1,7 @@ +from pathlib import Path + +out = [] +for line in Path("in/events.txt").read_text().split("\n"): + if not out or out[-1] != line: + out.append(line) +Path("out/result.txt").write_text("\n".join(out) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w03.py b/experiments/token-efficiency-heldout-v2/solutions/python/w03.py new file mode 100644 index 0000000..302b06d --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w03.py @@ -0,0 +1,4 @@ +from pathlib import Path + +lines = [line.split("#")[0].rstrip(" ") for line in Path("in/settings.txt").read_text().split("\n")] +Path("out/result.txt").write_text("\n".join(line for line in lines if line) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w04.py b/experiments/token-efficiency-heldout-v2/solutions/python/w04.py new file mode 100644 index 0000000..8ac8e03 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w04.py @@ -0,0 +1,4 @@ +from pathlib import Path + +lines = Path("in/headings.txt").read_text().split("\n") +Path("out/result.txt").write_text("\n".join(" ".join(w[:1].upper() + w[1:] for w in line.split(" ")) for line in lines) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w05.py b/experiments/token-efficiency-heldout-v2/solutions/python/w05.py new file mode 100644 index 0000000..797d050 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w05.py @@ -0,0 +1,8 @@ +import json +from pathlib import Path + +out = {} +for line in Path("in/ledger.csv").read_text().split("\n")[1:]: + _, account, amount = line.split(",") + out[account] = out.get(account, 0) + int(amount) +Path("out/result.json").write_text(json.dumps(out, indent=2) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w06.py b/experiments/token-efficiency-heldout-v2/solutions/python/w06.py new file mode 100644 index 0000000..1cfbdb8 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w06.py @@ -0,0 +1,8 @@ +import json +from pathlib import Path + +out = {} +for line in Path("in/ledger.csv").read_text().split("\n")[1:]: + date, _, amount = line.split(",") + out[date[:7]] = out.get(date[:7], 0) + int(amount) +Path("out/result.json").write_text(json.dumps(out, indent=2) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w07.py b/experiments/token-efficiency-heldout-v2/solutions/python/w07.py new file mode 100644 index 0000000..2f643eb --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w07.py @@ -0,0 +1,8 @@ +from pathlib import Path + +lines = Path("in/lines.csv").read_text().split("\n") +out = [lines[0] + ",total"] +for line in lines[1:]: + _, qty, unit = line.split(",") + out.append(f"{line},{int(qty) * int(unit)}") +Path("out/result.csv").write_text("\n".join(out) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w08.py b/experiments/token-efficiency-heldout-v2/solutions/python/w08.py new file mode 100644 index 0000000..4ebaac3 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w08.py @@ -0,0 +1,5 @@ +from pathlib import Path + +rows = [line.split(",") for line in Path("in/team.csv").read_text().split("\n")[1:]] +width = max(len(name) for name, _ in rows) +Path("out/result.txt").write_text("\n".join(f"{name.ljust(width)} | {role}" for name, role in rows) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w09.py b/experiments/token-efficiency-heldout-v2/solutions/python/w09.py new file mode 100644 index 0000000..b747c93 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w09.py @@ -0,0 +1,4 @@ +from pathlib import Path + +values = sorted(int(x) for x in Path("in/latency.txt").read_text().split("\n")) +Path("out/result.txt").write_text(f"{values[len(values) // 2]}\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w10.py b/experiments/token-efficiency-heldout-v2/solutions/python/w10.py new file mode 100644 index 0000000..afd8445 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w10.py @@ -0,0 +1,7 @@ +from pathlib import Path + +out = [] +for x in Path("in/seconds.txt").read_text().split("\n"): + s = int(x) + out.append(f"{s // 3600}:{s % 3600 // 60:02d}:{s % 60:02d}") +Path("out/result.txt").write_text("\n".join(out) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w11.py b/experiments/token-efficiency-heldout-v2/solutions/python/w11.py new file mode 100644 index 0000000..b9c3770 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w11.py @@ -0,0 +1,5 @@ +from collections import Counter +from pathlib import Path + +counts = Counter(int(x) // 10 for x in Path("in/ages.txt").read_text().strip().split(",")) +Path("out/result.txt").write_text("\n".join(f"{b * 10}-{b * 10 + 9}: {counts[b]}" for b in sorted(counts)) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w12.py b/experiments/token-efficiency-heldout-v2/solutions/python/w12.py new file mode 100644 index 0000000..9cb0210 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w12.py @@ -0,0 +1,5 @@ +import json +from pathlib import Path + +a = [int(x) for x in Path("in/load.txt").read_text().strip().split(",")] +Path("out/result.json").write_text(json.dumps([sum(a[i:i + 3]) // 3 for i in range(len(a) - 2)], indent=2) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w13.py b/experiments/token-efficiency-heldout-v2/solutions/python/w13.py new file mode 100644 index 0000000..c8ac96f --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w13.py @@ -0,0 +1,5 @@ +import json +from pathlib import Path + +jobs = json.loads(Path("in/jobs.json").read_text()) +Path("out/result.json").write_text(json.dumps([jobs[i:i + 3] for i in range(0, len(jobs), 3)], indent=2) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w14.py b/experiments/token-efficiency-heldout-v2/solutions/python/w14.py new file mode 100644 index 0000000..df8d44e --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w14.py @@ -0,0 +1,9 @@ +import json +from pathlib import Path + +left = json.loads(Path("in/left.json").read_text()) +right = json.loads(Path("in/right.json").read_text()) +out = [] +for i in range(max(len(left), len(right))): + out += left[i:i + 1] + right[i:i + 1] +Path("out/result.json").write_text(json.dumps(out, indent=2) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w15.py b/experiments/token-efficiency-heldout-v2/solutions/python/w15.py new file mode 100644 index 0000000..11032ec --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w15.py @@ -0,0 +1,6 @@ +import json +from pathlib import Path + +ring = json.loads(Path("in/ring.json").read_text()) +k = int(Path("in/k.txt").read_text()) % len(ring) +Path("out/result.json").write_text(json.dumps(ring[k:] + ring[:k], indent=2) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w16.py b/experiments/token-efficiency-heldout-v2/solutions/python/w16.py new file mode 100644 index 0000000..6a88c1e --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w16.py @@ -0,0 +1,5 @@ +import json +from pathlib import Path + +m = json.loads(Path("in/meter.json").read_text()) +Path("out/result.json").write_text(json.dumps([b - a for a, b in zip(m, m[1:])], indent=2) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w17.py b/experiments/token-efficiency-heldout-v2/solutions/python/w17.py new file mode 100644 index 0000000..cd0094c --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w17.py @@ -0,0 +1,5 @@ +from itertools import groupby +from pathlib import Path + +raw = Path("in/raw.txt").read_text().strip() +Path("out/result.txt").write_text("".join(f"{c}{len(list(g))}" for c, g in groupby(raw)) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w18.py b/experiments/token-efficiency-heldout-v2/solutions/python/w18.py new file mode 100644 index 0000000..5bbc429 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w18.py @@ -0,0 +1,4 @@ +from pathlib import Path + +lines = Path("in/idents.txt").read_text().split("\n") +Path("out/result.txt").write_text("\n".join("".join("_" + c.lower() if c.isupper() else c for c in line) for line in lines) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w19.py b/experiments/token-efficiency-heldout-v2/solutions/python/w19.py new file mode 100644 index 0000000..7ddeeef --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w19.py @@ -0,0 +1,4 @@ +from pathlib import Path + +msg = Path("in/msg.txt").read_text().strip() +Path("out/result.txt").write_text("".join(chr((ord(c) - 97 + 3) % 26 + 97) if "a" <= c <= "z" else c for c in msg) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w20.py b/experiments/token-efficiency-heldout-v2/solutions/python/w20.py new file mode 100644 index 0000000..baffab4 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w20.py @@ -0,0 +1,4 @@ +from pathlib import Path + +lines = Path("in/cards.txt").read_text().split("\n") +Path("out/result.txt").write_text("\n".join("*" * (len(line) - 4) + line[-4:] for line in lines) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w21.py b/experiments/token-efficiency-heldout-v2/solutions/python/w21.py new file mode 100644 index 0000000..9ecbfb3 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w21.py @@ -0,0 +1,8 @@ +import json +from pathlib import Path + +out = {} +for s in json.loads(Path("in/staff.json").read_text()): + if s["manager"]: + out.setdefault(s["manager"], []).append(s["name"]) +Path("out/result.json").write_text(json.dumps(out, indent=2) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w22.py b/experiments/token-efficiency-heldout-v2/solutions/python/w22.py new file mode 100644 index 0000000..2a79cd2 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w22.py @@ -0,0 +1,7 @@ +import json +from pathlib import Path + +users = json.loads(Path("in/users.json").read_text()) +scores = json.loads(Path("in/scores.json").read_text()) +lines = [f"{u['name']} {sum(s['points'] for s in scores if s['user'] == u['id'])}" for u in users] +Path("out/result.txt").write_text("\n".join(lines) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w23.py b/experiments/token-efficiency-heldout-v2/solutions/python/w23.py new file mode 100644 index 0000000..92d7884 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w23.py @@ -0,0 +1,7 @@ +import json +from pathlib import Path + +stock = json.loads(Path("in/stock.json").read_text()) +for m in json.loads(Path("in/moves.json").read_text()): + stock[m["sku"]] = stock.get(m["sku"], 0) + m["delta"] +Path("out/result.json").write_text(json.dumps(stock, indent=2) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w24.py b/experiments/token-efficiency-heldout-v2/solutions/python/w24.py new file mode 100644 index 0000000..441d132 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w24.py @@ -0,0 +1,8 @@ +import json +from pathlib import Path + +out = {} +for cart in json.loads(Path("in/carts.json").read_text()): + for item in cart["items"]: + out[item["sku"]] = out.get(item["sku"], 0) + item["qty"] +Path("out/result.json").write_text(json.dumps(out, indent=2) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w25.py b/experiments/token-efficiency-heldout-v2/solutions/python/w25.py new file mode 100644 index 0000000..35a7d22 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w25.py @@ -0,0 +1,5 @@ +from pathlib import Path + +n = int(Path("in/n.txt").read_text()) +primes = [p for p in range(2, n + 1) if all(p % d for d in range(2, int(p**0.5) + 1))] +Path("out/result.txt").write_text(" ".join(map(str, primes)) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w26.py b/experiments/token-efficiency-heldout-v2/solutions/python/w26.py new file mode 100644 index 0000000..07c94ce --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w26.py @@ -0,0 +1,8 @@ +from pathlib import Path + +n = int(Path("in/n.txt").read_text()) +steps = 0 +while n != 1: + n = n // 2 if n % 2 == 0 else 3 * n + 1 + steps += 1 +Path("out/result.txt").write_text(f"{steps}\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w27.py b/experiments/token-efficiency-heldout-v2/solutions/python/w27.py new file mode 100644 index 0000000..5f6c601 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w27.py @@ -0,0 +1,8 @@ +from pathlib import Path + +out = [] +for line in Path("in/years.txt").read_text().split("\n"): + y = int(line) + leap = y % 4 == 0 and (y % 100 != 0 or y % 400 == 0) + out.append(f"{y} {'leap' if leap else 'common'}") +Path("out/result.txt").write_text("\n".join(out) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w28.py b/experiments/token-efficiency-heldout-v2/solutions/python/w28.py new file mode 100644 index 0000000..11e8eb8 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w28.py @@ -0,0 +1,11 @@ +from pathlib import Path + +moves = {("closed", "open"): "opened", ("opened", "close"): "closed", ("closed", "lock"): "locked", ("locked", "unlock"): "closed"} +state = "closed" +result = None +for n, cmd in enumerate(Path("in/cmds.txt").read_text().split("\n"), 1): + if (state, cmd) not in moves: + result = f"error line {n}: cannot {cmd} when {state}" + break + state = moves[state, cmd] +Path("out/result.txt").write_text((result or state) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w29.py b/experiments/token-efficiency-heldout-v2/solutions/python/w29.py new file mode 100644 index 0000000..9dc2a5b --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w29.py @@ -0,0 +1,11 @@ +from pathlib import Path + +budget = int(Path("in/budget.txt").read_text()) +result = "within budget" +total = 0 +for n, x in enumerate(Path("in/spend.txt").read_text().split("\n"), 1): + total += int(x) + if total > budget: + result = f"over at {n}" + break +Path("out/result.txt").write_text(result + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w30.py b/experiments/token-efficiency-heldout-v2/solutions/python/w30.py new file mode 100644 index 0000000..5f33cf6 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w30.py @@ -0,0 +1,9 @@ +import json +from pathlib import Path + +values = {"I": 1, "V": 5, "X": 10, "L": 50, "C": 100, "D": 500, "M": 1000} +out = [] +for line in Path("in/romans.txt").read_text().split("\n"): + ds = [values[c] for c in line] + out.append(sum(-d if i + 1 < len(ds) and d < ds[i + 1] else d for i, d in enumerate(ds))) +Path("out/result.json").write_text(json.dumps(out, indent=2) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w31.py b/experiments/token-efficiency-heldout-v2/solutions/python/w31.py new file mode 100644 index 0000000..c92611b --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w31.py @@ -0,0 +1,4 @@ +from pathlib import Path + +lines = Path("in/nums.txt").read_text().split("\n") +Path("out/result.txt").write_text("\n".join(format(int(x), "b") for x in lines) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w32.py b/experiments/token-efficiency-heldout-v2/solutions/python/w32.py new file mode 100644 index 0000000..84feb40 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w32.py @@ -0,0 +1,13 @@ +from pathlib import Path + + +def luhn(digits): + total = 0 + for i, c in enumerate(reversed(digits)): + d = int(c) * (2 if i % 2 else 1) + total += d - 9 if d > 9 else d + return total % 10 == 0 + + +lines = Path("in/ids.txt").read_text().split("\n") +Path("out/result.txt").write_text("\n".join(f"{x} {'valid' if luhn(x) else 'invalid'}" for x in lines) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w33.py b/experiments/token-efficiency-heldout-v2/solutions/python/w33.py new file mode 100644 index 0000000..1ee378a --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w33.py @@ -0,0 +1,6 @@ +import json +from pathlib import Path + +board = sorted(json.loads(Path("in/board.json").read_text()), key=lambda e: (-e["score"], e["name"])) +scores = sorted({e["score"] for e in board}, reverse=True) +Path("out/result.txt").write_text("\n".join(f"{scores.index(e['score']) + 1} {e['name']} {e['score']}" for e in board) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w34.py b/experiments/token-efficiency-heldout-v2/solutions/python/w34.py new file mode 100644 index 0000000..c5315d5 --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w34.py @@ -0,0 +1,10 @@ +from pathlib import Path + +grid = Path("in/maze.txt").read_text().split("\n") +r = next(i for i, row in enumerate(grid) if "S" in row) +c = grid[r].index("S") +walls = 0 +for y, x in ((r - 1, c), (r + 1, c), (r, c - 1), (r, c + 1)): + if 0 <= y < len(grid) and 0 <= x < len(grid[y]) and grid[y][x] == "#": + walls += 1 +Path("out/result.txt").write_text(f"{r},{c} {walls}\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w35.py b/experiments/token-efficiency-heldout-v2/solutions/python/w35.py new file mode 100644 index 0000000..4b7364d --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w35.py @@ -0,0 +1,7 @@ +import json +from pathlib import Path + +prices = json.loads(Path("in/prices.json").read_text()) +target = int(Path("in/target.txt").read_text()) +pairs = [(i, j) for j in range(len(prices)) for i in range(j) if prices[i] + prices[j] == target] +Path("out/result.txt").write_text((f"{pairs[0][0]} {pairs[0][1]}" if pairs else "none") + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w36.py b/experiments/token-efficiency-heldout-v2/solutions/python/w36.py new file mode 100644 index 0000000..3fccf8d --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w36.py @@ -0,0 +1,15 @@ +from pathlib import Path + + +def check(p): + if len(p) < 8: + return "too short" + if not any(c.isdigit() for c in p): + return "no digit" + if not any("A" <= c <= "Z" for c in p): + return "no upper" + return "ok" + + +lines = Path("in/passwords.txt").read_text().split("\n") +Path("out/result.txt").write_text("\n".join(check(p) for p in lines) + "\n") diff --git a/experiments/token-efficiency-heldout-v2/solutions/python/w37.py b/experiments/token-efficiency-heldout-v2/solutions/python/w37.py new file mode 100644 index 0000000..42868ea --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/solutions/python/w37.py @@ -0,0 +1,6 @@ +from pathlib import Path + +b = Path("in/board.txt").read_text().replace("\n", "") +lines = [(0, 1, 2), (3, 4, 5), (6, 7, 8), (0, 3, 6), (1, 4, 7), (2, 5, 8), (0, 4, 8), (2, 4, 6)] +winners = [b[i] for i, j, k in lines if b[i] != "." and b[i] == b[j] == b[k]] +Path("out/result.txt").write_text((winners[0] if winners else "open" if "." in b else "draw") + "\n") diff --git a/experiments/token-efficiency-heldout-v2/verification_test.go b/experiments/token-efficiency-heldout-v2/verification_test.go new file mode 100644 index 0000000..fb6395f --- /dev/null +++ b/experiments/token-efficiency-heldout-v2/verification_test.go @@ -0,0 +1,84 @@ +package heldoutv2 + +import ( + "crypto/sha256" + "encoding/json" + "fmt" + "os" + "path/filepath" + "testing" +) + +var exts = map[string]string{"howl": "howl", "python": "py", "js": "js", "go": "go"} + +func readJSON(t *testing.T, path string, v any) { + t.Helper() + data, err := os.ReadFile(path) + if err != nil { + t.Fatal(err) + } + if err := json.Unmarshal(data, v); err != nil { + t.Fatal(err) + } +} + +// Every task × language is either verified (pass, matching hash) or an +// explicitly recorded HowlFrame gap with a reason and no solution file. +func TestHeldoutV2VerificationCoverage(t *testing.T) { + var manifest struct { + Tasks []struct { + ID string `json:"id"` + } `json:"tasks"` + } + readJSON(t, "tasks/manifest.json", &manifest) + var gaps []struct{ Task, Lang, Reason string } + readJSON(t, "gaps.json", &gaps) + var results []struct { + Task, Lang, SHA256 string + Pass bool + } + readJSON(t, "results/verification.json", &results) + if len(manifest.Tasks) < 30 { + t.Fatalf("held-out corpus has %d tasks, want >= 30", len(manifest.Tasks)) + } + gapped := map[string]bool{} + for _, g := range gaps { + if g.Lang != "howl" || g.Reason == "" { + t.Errorf("gap %s/%s must be a HowlFrame gap with a reason", g.Task, g.Lang) + } + gapped[g.Task+"/"+g.Lang] = true + if _, err := os.Stat(filepath.Join("solutions", g.Lang, g.Task+"."+exts[g.Lang])); err == nil { + t.Errorf("gap %s/%s has a solution file", g.Task, g.Lang) + } + } + seen := map[string]bool{} + for _, r := range results { + key := r.Task + "/" + r.Lang + if seen[key] || gapped[key] { + t.Errorf("duplicate or gapped entry %s", key) + } + seen[key] = true + if !r.Pass { + t.Errorf("%s did not pass", key) + } + src, err := os.ReadFile(filepath.Join("solutions", r.Lang, r.Task+"."+exts[r.Lang])) + if err != nil { + t.Errorf("%s: %v", key, err) + continue + } + if got := fmt.Sprintf("%x", sha256.Sum256(src)); got != r.SHA256 { + t.Errorf("%s: stale hash", key) + } + } + for _, task := range manifest.Tasks { + for lang := range exts { + key := task.ID + "/" + lang + if !seen[key] && !gapped[key] { + t.Errorf("missing %s", key) + } + } + } + if want := len(manifest.Tasks)*len(exts) - len(gaps); len(results) != want { + t.Errorf("%d results, want %d", len(results), want) + } +}