Skip to content

Instantly share code, notes, and snippets.

View penberg's full-sized avatar

Pekka Enberg penberg

View GitHub Profile
@penberg
penberg / tcl-conformance-2026-10-09.md
Created October 9, 2026 10:56
Turso upstream SQLite TCL conformance run (all.test) — 2026-10-09

Turso upstream SQLite TCL conformance run (all.test) — 2026-10-09

Results of running Turso's upstream SQLite TCL conformance suite (sqlite/conformance/upstream/all.test) on October 9, 2026, on main at 9f98e9990 ("Merge 'core/mvcc: stop AUTOINCREMENT from overwriting a row inserted with explicit id 1' from Jussi Saurio"), the head of origin/main at the time of the run. TCL bindings rebuilt from the same commit against a release build of turso_sqlite3, tclsh 9.0.2. Run from an empty directory. Wall-clock: 13.0 minutes.

Summary

  • 330,045 / 339,858 tests passed (97.1%)
  • 221 files fully passing (blessed)
  • 493 known-bad files that ran to their summary (XFAIL)
  • 88 files that stopped on an error outside of a test (XABORT; their tests up to the stop are counted)
@penberg
penberg / tcl-conformance-2026-10-08.md
Created October 8, 2026 09:11
Turso upstream SQLite TCL conformance run (all.test) — 2026-10-08

Turso upstream SQLite TCL conformance run (all.test) — 2026-10-08

Results of running Turso's upstream SQLite TCL conformance suite (sqlite/conformance/upstream/all.test) on October 8, 2026, on main at 8cc059bd9 ("Merge 'core/mvcc: keep the index map of a rolled-back CREATE INDEX alive for open cursors' from Jussi Saurio"). TCL bindings rebuilt from the same commit against a release build of turso_sqlite3, tclsh 9.0.2. Run from an empty directory. Wall-clock: 11.4 minutes.

Summary

  • 330,037 / 339,846 tests passed (97.1%)
  • 221 files fully passing (blessed)
  • 490 known-bad files that ran to their summary (XFAIL)
  • 87 files that stopped on an error outside of a test (XABORT; their tests up to the stop are counted)
@penberg
penberg / tcl-conformance-2026-09-30.md
Created September 30, 2026 05:16
Turso upstream SQLite TCL conformance run (all.test) — 2026-09-30

Turso upstream SQLite TCL conformance run (all.test) — 2026-09-30

Results of running Turso's upstream SQLite TCL conformance suite (sqlite/conformance/upstream/all.test) on September 30, 2026, on main at 33c1036a3 ("Merge 'fix build' from Mikaël Francoeur"). TCL bindings rebuilt from the same commit against a release build of turso_sqlite3, tclsh 9.0.2. Wall-clock: 11.7 minutes.

Summary

  • 326,569 / 339,246 tests passed (96.3%)
  • 209 files fully passing (blessed)
  • 497 known-bad files that ran to their summary (XFAIL)
  • 93 files that stopped on an error outside of a test (XABORT; their tests up to the stop are counted)
@penberg
penberg / tcl-conformance-2026-09-29.md
Created September 29, 2026 06:54
Turso upstream SQLite TCL conformance run (all.test) — 2026-09-29

Turso upstream SQLite TCL conformance run (all.test) — 2026-09-29

Results of running Turso's upstream SQLite TCL conformance suite (sqlite/conformance/upstream/all.test) on September 29, 2026, on main at 1300161c0 ("Add NuGet badge to README.md"). TCL bindings rebuilt from the same commit against a release build of turso_sqlite3, tclsh 9.0.2. Wall-clock: 12.2 minutes.

Summary

  • 325,646 / 340,722 tests passed (95.6%)
  • 208 files fully passing (blessed)
  • 498 known-bad files that ran to their summary (XFAIL)
  • 93 files that stopped on an error outside of a test (XABORT; their tests up to the stop are counted)
@penberg
penberg / tcl-conformance-2026-09-14.md
Last active September 14, 2026 06:16
Turso upstream SQLite TCL conformance run (all.test) — 2026-09-14

Turso upstream SQLite TCL conformance run (all.test) — 2026-09-14

Results of running Turso's upstream SQLite TCL conformance suite (sqlite/conformance/upstream/all.test) on September 14, 2026, on main at 7f3c855b2 ("Merge 'core/json: make json106.test pass'"). TCL bindings rebuilt from the same commit against a release build of turso_sqlite3, tclsh 9.0.2. Wall-clock: 12.3 minutes.

Summary

  • 321,770 / 341,025 tests passed (94.4%)
  • 206 files fully passing (blessed)
  • 499 known-bad files that ran to their summary (XFAIL)
  • 93 files that stopped on an error outside of a test (XABORT; their tests up to the stop are counted)
@penberg
penberg / turso-tcl-conformance-2026-09-13.md
Created September 13, 2026 11:07
Turso upstream SQLite TCL conformance run (all.test) — 2026-09-13

Turso upstream SQLite TCL conformance run (all.test) — 2026-09-13

Results of running Turso's upstream SQLite TCL conformance suite (sqlite/conformance/upstream/all.test) on September 13, 2026, on main at 05766d390 ("Merge 'sqlite/conformance: run every file in the upstream TCL suite'", PR #8974). TCL bindings rebuilt from the same commit against a release build of turso_sqlite3, tclsh 9.0.2. Wall-clock: 12.4 minutes.

Summary

  • 311,541 / 340,908 tests passed (91.4%)
  • 203 files fully passing (blessed)
  • 500 known-bad files that ran to their summary (XFAIL)
  • 95 files that stopped on an error outside of a test (XABORT; their tests up to the stop are counted)

Executing code on a GPU vs CPU

I have had working knowledge of GPUs for a very long time now. I remember playing around with NVIDIA RIVA 128 or something similar with DirectX when they were still 3D graphics accelerators. I have also tried to keep up with the times and did some basic shader programming on a contemporary NVIDIA or AMD GPU.

However, today's GPUs are necessary for another reason – the explosion of AI workloads, including large language models (LLMs). From a GPU perspective, AI workloads are just massive applications of tensor operations such as matrix addition and multiplication. However, how does the modern GPU execute them, which is much more efficient than running the workloads on a CPU?

Consider CUDA, NVIDIA's programming language that extends C to exploit data parallelism on GPUs. In CUDA, you write code for CPU (host code) or GPU (device code). CPU code is just mostly plain C, but CUDA extends the language in two ways: it allows you to define functions for GPUs (kernels) and also prov

#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
static uint64_t timespec_to_ns(struct timespec *ts)
{
return ts->tv_sec * 1e9 + ts->tv_nsec;
}