2018 / Day 21
Chronal Conversion
Read the original puzzle on adventofcode.com ↗
The solution
solution.c
1#include "aoc.h"
2
3typedef struct {
4 slice s;
5 size_t i;
6} Parser;
7
8static int space(uint8_t c) {
9 return c == ' ' || c == '\t' || c == '\r' || c == '\n';
10}
11
12static void ws(Parser *p) {
13 while (p->i < p->s.l && space(p->s.p[p->i])) {
14 p->i++;
15 }
16}
17
18static void text(Parser *p, const char *s) {
19 size_t n = strlen(s);
20 aoc_assert(n <= p->s.l - p->i && !memcmp(p->s.p + p->i, s, n), "bad input");
21 p->i += n;
22}
23
24static int64_t number(Parser *p, int64_t cap) {
25 int neg = 0;
26 int64_t v = 0;
27 if (p->i < p->s.l && (p->s.p[p->i] == '-' || p->s.p[p->i] == '+')) {
28 neg = p->s.p[p->i++] == '-';
29 }
30 size_t start = p->i;
31 while (p->i < p->s.l && p->s.p[p->i] >= '0' && p->s.p[p->i] <= '9') {
32 int d = p->s.p[p->i++] - '0';
33 aoc_assert(v <= (cap - d) / 10 && d <= cap, "integer exceeds cap");
34 v = v * 10 + d;
35 }
36 aoc_assert(p->i > start, "expected integer");
37 return neg ? -v : v;
38}
39
40static void finish(Parser *p) {
41 ws(p);
42 aoc_assert(p->i == p->s.l, "trailing input");
43}
44
45static slice line(Parser *p) {
46 size_t b = p->i;
47 while (p->i < p->s.l && p->s.p[p->i] != '\n') {
48 p->i++;
49 }
50 size_t e = p->i;
51 if (e > b && p->s.p[e - 1] == '\r') {
52 e--;
53 }
54 if (p->i < p->s.l) {
55 p->i++;
56 }
57 return (slice){b ? p->s.p + b : p->s.p, e - b};
58}
59
60static int64_t absolute(int64_t x) {
61 return x < 0 ? -x : x;
62}
63
64/* The machine is not run until a halt succeeds, and a repeated
65 * candidate value is not treated as a cycle. Register zero is assumed
66 * to be read only by the final equality that decides whether to halt;
67 * that gate is checked, and any other use is refused. The first
68 * candidate is therefore the fastest halt. Forcing the comparison false
69 * until the whole machine state repeats leaves the last candidate not
70 * seen earlier, the longest terminating run. The integer-division loop
71 * is recognized and replaced, so the quotient is not walked by
72 * subtraction.
73 *
74 * The program is assumed to be an #ip file of at most PROGMAX
75 * instructions ending in that gate, cycling inside STATES full states
76 * and STEPS steps, with operands in IMAX, registers in REGCAP, and the
77 * division operand in DIVCAP. A bad header, another use of register
78 * zero, or a gate that is not those last three instructions is refused
79 * ("bad input", "integer exceeds cap", "expected integer", "trailing
80 * input", "bad IP register", "program exceeds cap", "bad opcode", "bad
81 * destination", "empty program", "register zero is the IP", "multiple
82 * halt comparisons", "unsupported halt gate", "register zero used
83 * outside halt gate"). A run past the caps is "negative halt
84 * candidate", "halt cycle exceeds cap", "division loop exceeds cap",
85 * "device work exceeds cap", "invalid device operation", or "program
86 * ended before halt cycle". Collapsing the division leaves one
87 * instruction per step, and the cycle test is six registers at the
88 * gate.
89 *
90 * The real program is #ip 1 and 31 instructions, short enough to read. It ends
91 * by comparing register 3 with register 0: that is the only halt. Above it, a
92 * loop multiplies by 256 and compares, which is the division the replacement
93 * folds. The mask in the file is 16777215, so a candidate is 24 bits. STATES =
94 * 65536 bounds how many are remembered.
95 */
96enum { PROGMAX = 256 };
97
98enum { STATES = 65536, SLOTS = STATES * 2 };
99
100enum { STEPS = 5000000 };
101
102enum { IMAX = 1000000000 };
103
104static const int64_t REGCAP = 1000000000000000LL;
105
106static const int64_t DIVCAP = 1000000000000LL;
107
108static const char *opnames[16] = {
109 "addr", "addi", "mulr", "muli", "banr", "bani", "borr", "bori",
110 "setr", "seti", "gtir", "gtri", "gtrr", "eqir", "eqri", "eqrr"};
111
112static int apply(int op, int64_t a, int64_t b, int c, int64_t *r, int nr) {
113 if (c < 0 || c >= nr) {
114 return 0;
115 }
116 int ar = op == 0 || op == 1 || op == 2 || op == 3 || op == 4 || op == 5 ||
117 op == 6 || op == 7 || op == 8 || op == 11 || op == 12 ||
118 op == 14 || op == 15;
119 int br = op == 0 || op == 2 || op == 4 || op == 6 || op == 10 || op == 12 ||
120 op == 13 || op == 15;
121 if ((ar && (a < 0 || a >= nr)) || (br && (b < 0 || b >= nr))) {
122 return 0;
123 }
124 int64_t x = ar ? r[a] : a, y = br ? r[b] : b, v = 0;
125 switch (op) {
126 case 0:
127 case 1:
128 v = x + y;
129 break;
130 case 2:
131 case 3:
132 if (y && absolute(x) > REGCAP / absolute(y)) {
133 return 0;
134 }
135 v = x * y;
136 break;
137 case 4:
138 case 5:
139 v = x & y;
140 break;
141 case 6:
142 case 7:
143 v = x | y;
144 break;
145 case 8:
146 case 9:
147 v = x;
148 break;
149 case 10:
150 case 11:
151 case 12:
152 v = x > y;
153 break;
154 default:
155 v = x == y;
156 }
157 if (absolute(v) > REGCAP) {
158 return 0;
159 }
160 r[c] = v;
161 return 1;
162}
163
164typedef struct {
165 int op;
166 int64_t a, b;
167 int c;
168} Instruction;
169
170static Instruction code[PROGMAX];
171static int n, ip;
172
173static inline __attribute__((always_inline)) int
174identify_device_opcode(Parser q, int op) {
175 for (int i = 0; i < 16; i++) {
176 if (q.s.l >= 5 && !memcmp(q.s.p, opnames[i], 4) && q.s.p[4] == ' ') {
177 op = i;
178 }
179 }
180
181 return op;
182}
183
184static void load(slice in) {
185 Parser p = {in, 0};
186 Parser q = {line(&p), 0};
187 text(&q, "#ip ");
188 ip = (int)number(&q, 5);
189 aoc_assert(ip >= 0, "bad IP register");
190 finish(&q);
191 n = 0;
192 while (p.i < in.l) {
193 aoc_assert(n < PROGMAX, "program exceeds cap");
194 q = (Parser){line(&p), 0};
195 int op = -1;
196 op = identify_device_opcode(q, op);
197 aoc_assert(op >= 0, "bad opcode");
198 q.i = 5;
199 int64_t a = number(&q, IMAX);
200 text(&q, " ");
201 int64_t b = number(&q, IMAX);
202 text(&q, " ");
203 int c = (int)number(&q, 5);
204 finish(&q);
205 aoc_assert(c >= 0, "bad destination");
206 code[n++] = (Instruction){op, a, b, c};
207 }
208 aoc_assert(n, "empty program");
209}
210
211static int ins(int p, int op, int64_t a, int64_t b, int c) {
212 return p < n && code[p].op == op && code[p].a == a &&
213 (op == 8 || op == 9 || code[p].b == b) && code[p].c == c;
214}
215
216static int comm(int p, int op, int a, int b, int c) {
217 return ins(p, op, a, b, c) || ins(p, op, b, a, c);
218}
219
220static int64_t states[STATES][6], values[SLOTS];
221static uint32_t state_slots[SLOTS];
222static uint8_t value_used[SLOTS];
223static int stored;
224
225static int divide_loop(int p, int64_t r[6]) {
226 if (p + 10 > n || code[p].op != 9) {
227 return 0;
228 }
229 int q = code[p].c, t = code[p + 1].c, source = (int)code[p + 3].b;
230 int64_t factor = code[p + 2].b;
231 uint32_t mask = 0;
232 int roles[4] = {q, t, source, ip};
233 for (int i = 0; i < 4; i++) {
234 if (roles[i] <= 0 || roles[i] >= 6 || (mask & (1U << roles[i]))) {
235 return 0;
236 }
237 mask |= 1U << roles[i];
238 }
239 if (!(factor > 1 && ins(p, 9, 0, 0, q) && ins(p + 1, 1, q, 1, t) &&
240 ins(p + 2, 3, t, factor, t) && ins(p + 3, 12, t, source, t) &&
241 comm(p + 4, 0, t, ip, ip) && ins(p + 5, 1, ip, 1, ip) &&
242 ins(p + 6, 9, p + 8, 0, ip) && ins(p + 7, 1, q, 1, q) &&
243 ins(p + 8, 9, p, 0, ip) && ins(p + 9, 8, q, 0, source))) {
244 return 0;
245 }
246 aoc_assert(r[source] >= 0 && r[source] <= DIVCAP,
247 "division loop exceeds cap");
248 r[q] = r[source] / factor;
249 r[t] = 1;
250 r[source] = r[q];
251 r[ip] = p + 9;
252 return 1;
253}
254
255static uint64_t mix(uint64_t v) {
256 v ^= v >> 30;
257 v *= 0xbf58476d1ce4e5b9ULL;
258 v ^= v >> 27;
259 v *= 0x94d049bb133111ebULL;
260 return v ^ (v >> 31);
261}
262
263static inline __attribute__((always_inline)) uint64_t
264hash_register_state(int64_t r[6], uint64_t key) {
265 for (int i = 0; i < 6; i++) {
266 key = mix(key ^ (uint64_t)r[i]);
267 }
268
269 return key;
270}
271
272static inline __attribute__((always_inline)) uint32_t
273find_register_state_slot(int64_t r[6], uint32_t slot) {
274 while (state_slots[slot] &&
275 memcmp(states[state_slots[slot] - 1], r, sizeof(int64_t[6]))) {
276 slot = (slot + 1) & (SLOTS - 1);
277 }
278
279 return slot;
280}
281
282static inline __attribute__((always_inline)) uint32_t
283find_halt_value_slot(int64_t value, uint32_t slot) {
284 while (value_used[slot] && values[slot] != value) {
285 slot = (slot + 1) & (SLOTS - 1);
286 }
287
288 return slot;
289}
290
291static slice solve(slice in, int longest) {
292 load(in);
293 aoc_assert(ip != 0, "register zero is the IP");
294 int halt = -1, observed = -1, condition = -1;
295 for (int i = 0; i < n; i++) {
296 if (code[i].op == 15 && (code[i].a == 0 || code[i].b == 0)) {
297 aoc_assert(halt < 0, "multiple halt comparisons");
298 halt = i;
299 observed = (int)(code[i].a == 0 ? code[i].b : code[i].a);
300 condition = code[i].c;
301 }
302 }
303 aoc_assert(halt == n - 3 && observed > 0 && observed < 6 &&
304 condition != 0 && condition != ip &&
305 comm(halt + 1, 0, condition, ip, ip) &&
306 code[halt + 2].op == 9 && code[halt + 2].c == ip,
307 "unsupported halt gate");
308 for (int i = 0; i < n; i++) {
309 Instruction a = code[i];
310 int ar = a.op == 0 || a.op == 1 || a.op == 2 || a.op == 3 ||
311 a.op == 4 || a.op == 5 || a.op == 6 || a.op == 7 ||
312 a.op == 8 || a.op == 11 || a.op == 12 || a.op == 14 ||
313 a.op == 15;
314 int br = a.op == 0 || a.op == 2 || a.op == 4 || a.op == 6 ||
315 a.op == 10 || a.op == 12 || a.op == 13 || a.op == 15;
316 aoc_assert(a.c != 0 &&
317 (i == halt || !((ar && a.a == 0) || (br && a.b == 0))),
318 "register zero used outside halt gate");
319 }
320 memset(state_slots, 0, sizeof state_slots);
321 memset(value_used, 0, sizeof value_used);
322 stored = 0;
323 int64_t r[6] = {0}, pc = 0, last = -1;
324 int work = 0;
325 while (pc >= 0 && pc < n) {
326 aoc_assert(++work <= STEPS, "device work exceeds cap");
327 r[ip] = pc;
328 if (pc == halt) {
329 int64_t value = r[observed];
330 aoc_assert(value >= 0, "negative halt candidate");
331 if (!longest) {
332 return slice_from_i64(value);
333 }
334 uint64_t key = 0;
335 key = hash_register_state(r, key);
336 uint32_t slot = (uint32_t)key & (SLOTS - 1);
337 slot = find_register_state_slot(r, slot);
338 if (state_slots[slot]) {
339 return slice_from_i64(last);
340 }
341 aoc_assert(stored < STATES, "halt cycle exceeds cap");
342 memcpy(states[stored], r, sizeof r);
343 state_slots[slot] = (uint32_t)++stored;
344 slot = (uint32_t)mix((uint64_t)value) & (SLOTS - 1);
345 slot = find_halt_value_slot(value, slot);
346 if (!value_used[slot]) {
347 value_used[slot] = 1;
348 values[slot] = value;
349 last = value;
350 }
351 r[condition] = 0;
352 pc++;
353 continue;
354 }
355 if (divide_loop((int)pc, r)) {
356 pc += 10;
357 continue;
358 }
359 Instruction a = code[pc];
360 aoc_assert(apply(a.op, a.a, a.b, a.c, r, 6),
361 "invalid device operation");
362 pc = r[ip] + 1;
363 }
364 aoc_assert(0, "program ended before halt cycle");
365}
366
367slice part1(slice in) {
368 return solve(in, 0);
369}
370
371slice part2(slice in) {
372 return solve(in, 1);
373}
374
375const struct aoc_method aoc_methods[] = {
376 {0, 0},
377};aoc.h
1#ifndef AOC_H
2#define AOC_H
3
4#include <stdarg.h>
5#include <stddef.h>
6#include <stdint.h>
7#include <stdlib.h>
8#include <string.h>
9
10/* The only required boundary between infra and a solution.
11 * `input` is read-only and is not owned by the solution.
12 * The returned slice is allocated with malloc. It is the only
13 * block still live when the function returns. Infra copies it
14 * and then frees it.
15 */
16typedef struct {
17 uint8_t *p;
18 size_t l;
19} slice;
20
21/* p is null and l is 0. Infra uses this when a run has no output. */
22static const slice empty_slice = {0};
23
24typedef slice (*aoc_fn)(slice);
25
26/* One named method. The name is a C identifier, at most 31
27 * characters, and it is the URL suffix: /YYYY/D/P/<name>.
28 * estimate and span are examples, not a fixed list. A day
29 * exports as many as it wants. The array ends with {0, 0}.
30 * part1 and part2 are not entries in this list.
31 */
32struct aoc_method {
33 const char *name;
34 aoc_fn fn;
35};
36
37slice part1(slice input);
38slice part2(slice input);
39
40extern const struct aoc_method aoc_methods[];
41
42/* Provided by the runtime. Records msg and returns. */
43void aoc_fail(const char *msg);
44
45/* Stops the run when cond is false and reports msg. */
46_Noreturn void aoc_assert_fail(const char *msg);
47#ifndef aoc_assert
48#define aoc_assert(cond, msg) \
49 do { \
50 if (!(cond)) { \
51 aoc_assert_fail(msg); \
52 } \
53 } while (0)
54#endif
55
56/* Decimal text of a uint64_t is at most 20 digits. A sign and a
57 * little spare fit here. Size a number buffer from this.
58 */
59enum { AOC_I64_TEXT = 32 };
60
61/* Decimal digits of v. No sign. d has room for 20 digits. */
62static inline char *aoc_u64_text(char *d, uint64_t v) {
63 char tmp[AOC_I64_TEXT];
64 char *end = tmp + AOC_I64_TEXT;
65 char *p = end;
66 size_t n;
67 do {
68 *--p = (char)('0' + (v % 10ull));
69 v /= 10ull;
70 } while (v);
71 n = (size_t)(end - p);
72 memcpy(d, p, n);
73 return d + n;
74}
75
76/* Decimal digits of v. The minimum int64_t is not negated. */
77static inline char *aoc_i64_text(char *d, int64_t v) {
78 uint64_t u;
79 if (v < 0) {
80 *d++ = '-';
81 u = (uint64_t)(-(v + 1)) + 1ull;
82 } else {
83 u = (uint64_t)v;
84 }
85 return aoc_u64_text(d, u);
86}
87
88/* n values, one space between them. The author knows the order. */
89static inline char *aoc_u64s(char *d, const uint64_t *v, size_t n) {
90 size_t i;
91 for (i = 0; i < n; i++) {
92 if (i) {
93 *d++ = ' ';
94 }
95 d = aoc_u64_text(d, v[i]);
96 }
97 return d;
98}
99
100static inline char *aoc_i64s(char *d, const int64_t *v, size_t n) {
101 size_t i;
102 for (i = 0; i < n; i++) {
103 if (i) {
104 *d++ = ' ';
105 }
106 d = aoc_i64_text(d, v[i]);
107 }
108 return d;
109}
110
111static inline char *aoc_ints(char *d, const int *v, size_t n) {
112 size_t i;
113 for (i = 0; i < n; i++) {
114 if (i) {
115 *d++ = ' ';
116 }
117 d = aoc_i64_text(d, (int64_t)v[i]);
118 }
119 return d;
120}
121
122/* Write fmt at buf. Return the cursor for the next call.
123 * %d takes int. %i takes int64_t. %u takes uint64_t.
124 * %s takes a C string. %% is a percent sign.
125 * A literal run is memcpy.
126 * %D takes (int *, size_t). %I takes (int64_t *, size_t).
127 * %U takes (uint64_t *, size_t). One space between values.
128 */
129static inline char *aoc_vprintf(const char *fmt, char *buf, va_list ap) {
130 while (*fmt) {
131 const char *lit = fmt;
132 size_t n;
133 while (*fmt && *fmt != '%') {
134 fmt++;
135 }
136 n = (size_t)(fmt - lit);
137 if (n) {
138 memcpy(buf, lit, n);
139 buf += n;
140 }
141 if (*fmt != '%') {
142 break;
143 }
144 fmt++;
145 if (*fmt == '%') {
146 *buf++ = '%';
147 fmt++;
148 continue;
149 }
150 if (*fmt == 's') {
151 const char *s = va_arg(ap, const char *);
152 n = strlen(s);
153 if (n) {
154 memcpy(buf, s, n);
155 buf += n;
156 }
157 fmt++;
158 continue;
159 }
160 if (*fmt == 'd') {
161 buf = aoc_i64_text(buf, (int64_t)va_arg(ap, int));
162 fmt++;
163 continue;
164 }
165 if (*fmt == 'i') {
166 buf = aoc_i64_text(buf, va_arg(ap, int64_t));
167 fmt++;
168 continue;
169 }
170 if (*fmt == 'u') {
171 buf = aoc_u64_text(buf, va_arg(ap, uint64_t));
172 fmt++;
173 continue;
174 }
175 if (*fmt == 'D') {
176 const int *v = va_arg(ap, int *);
177 buf = aoc_ints(buf, v, va_arg(ap, size_t));
178 fmt++;
179 continue;
180 }
181 if (*fmt == 'I') {
182 const int64_t *v = va_arg(ap, int64_t *);
183 buf = aoc_i64s(buf, v, va_arg(ap, size_t));
184 fmt++;
185 continue;
186 }
187 if (*fmt == 'U') {
188 const uint64_t *v = va_arg(ap, uint64_t *);
189 buf = aoc_u64s(buf, v, va_arg(ap, size_t));
190 fmt++;
191 continue;
192 }
193 aoc_assert(0, "bad format");
194 }
195 return buf;
196}
197
198static inline char *aoc_printf(const char *fmt, char *buf, ...) {
199 va_list ap;
200 va_start(ap, buf);
201 buf = aoc_vprintf(fmt, buf, ap);
202 va_end(ap);
203 return buf;
204}
205
206/* Copy n bytes of text into a malloc'd slice. */
207static inline slice slice_from_text(const char *s, size_t n) {
208 uint8_t *p = malloc(n);
209 aoc_assert(p, "out of memory");
210 if (n) {
211 memcpy(p, s, n);
212 }
213 return (slice){p, n};
214}
215
216/* Decimal text of v, allocated at AOC_I64_TEXT. The minimum
217 * int64_t is not negated. slice.l is the bytes written.
218 */
219static inline slice slice_from_i64(int64_t v) {
220 char tmp[AOC_I64_TEXT];
221 char *d;
222 uint8_t *p;
223 size_t n;
224 d = aoc_printf("%i", tmp, v);
225 n = (size_t)(d - tmp);
226 p = malloc(AOC_I64_TEXT);
227 aoc_assert(p, "out of memory");
228 memcpy(p, tmp, n);
229 return (slice){p, n};
230}
231
232/* Parse one decimal slice into *out. A leading '-' is allowed.
233 * Returns 1 on success, 0 for invalid text or int64_t overflow.
234 */
235static inline int slice_to_i64(slice s, int64_t *out) {
236 size_t i = 0;
237 int neg = 0;
238 uint64_t u = 0;
239 if (!s.p || s.l == 0 || !out) {
240 return 0;
241 }
242 if (s.p[0] == '-') {
243 neg = 1;
244 i = 1;
245 if (s.l == 1) {
246 return 0;
247 }
248 }
249 for (; i < s.l; i++) {
250 uint8_t c = s.p[i];
251 if (c < '0' || c > '9') {
252 return 0;
253 }
254 uint64_t digit = (uint64_t)(c - '0');
255 uint64_t limit = (uint64_t)INT64_MAX + (uint64_t)neg;
256 if (u > (limit - digit) / 10u) {
257 return 0;
258 }
259 u = u * 10u + digit;
260 }
261 if (neg) {
262 *out = u == (uint64_t)INT64_MAX + 1u ? INT64_MIN : -(int64_t)u;
263 } else {
264 *out = (int64_t)u;
265 }
266 return 1;
267}
268
269#endifThe aha moment
We can choose register zero, so the obvious brute-force plan is to try values and time each execution. But a bad choice may run forever, and many choices would repeat the same enormous prefix of work. Before launching that search, read where register zero is actually used. The local program has only 31 instructions. Near the end, it compares register three with register zero; equality makes the program exit, while inequality starts another pass.
That is the first breakthrough. Register zero does not influence the candidate-generation work before this comparison. We do not need to keep asking the machine whether a guessed value will halt. Let the machine tell us which value would halt at each visit to the comparison. The first candidate it produces gives the fastest possible halt. Choosing a smaller number that appears later would not satisfy “fewest instructions.”
The opening bitwise check is worth respecting. Numeric AND of 123 and 456 is 72, so the startup test should pass. If an emulator treats the operation as a Boolean conjunction or manipulates textual digits, it can get stuck before reaching the real puzzle. A short trace distinguishes a broken interpreter from an intentionally long-running program.
Part two asks for the longest run that still terminates. Continue through the halt comparison as though it were false, recording candidates in arrival order. A candidate that appears again would have halted at its earlier occurrence if placed in register zero. Therefore the answer is the last newly encountered candidate before the generation process becomes cyclic—not the numerically largest candidate, and not necessarily the last value observed.
We still need to make that experiment finish. Above the comparison, a loop increments a trial quotient until its next multiple of 256 exceeds a source register. Its purpose is floor(source / 256). Replace the verified loop with integer division while preserving its final registers. In the local run this avoids roughly 426 million quotient increments and leaves 429,201 interpreted or collapsed steps to reach the repeated comparison state. Identifying that small arithmetic kernel is much more valuable than speeding up instruction dispatch.
What proves the candidates will now repeat forever? A repeated candidate alone is not generally enough; other registers might still differ and lead to a new future. The implementation compares the complete six-register state at the same halt instruction. In the local run there are 13,005 distinct comparison states but 13,004 distinct candidate values. The first candidate repetition precedes the full-state repetition by one visit. Keeping those two notions separate avoids building the stopping argument on an accidental property of one register.
The local state cycle begins at zero-based comparison visit 11,093 and has period 1,912. Once that exact state returns under the forced-false comparison, the deterministic future can produce no new candidate. The latest first occurrence we saved is therefore the slowest terminating choice. The 24-bit mask in the program bounds each local candidate below 16,777,216, but the experiment needs far fewer states than that full numerical range.
The supported program must have the validated final halt gate and use register zero only for that comparison. The division shortcut also requires the complete recognized instruction pattern. Bounds are 256 instructions, 65,536 saved comparison states, five million executed or collapsed steps, input operands within ±1,000,000,000, register magnitudes through 10^15, and division operands through 10^12. Unsupported gates or exhausted bounds are refused. We have changed the search from guessing inputs to observing the machine's own sequence of opportunities to stop.
See also
Categories for 2015–2024 adapted from u/Boojum’s 500 Stars: A Categorization and Mega-Guide ↗. A day can belong to several categories. Tags from 2025 onward are our additions.
Try your input
One POST, one reply. Your input is not saved.