nativeview-codegen 0.1.0-rc.1

Multi-language ABI, policy, flat-op codec, and hybrid Direct-FFI code generator for Native View Engine.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
//! Host ABI data generated with Askama templates (`packages/core/codegen/templates/`): the Core
//! and runtime scene ABIs, the word-table field specs, and the golden XXH64 vectors. Every file lands
//! next to the static runtime it plugs into (`packages/core/host-{cxx,swift,java,dart,ts}`).
//!
//! Inputs are borrowed: `nativeview-abi`'s `const` [`AbiFileDescriptor`]s and the `&'static TableDesc`s of
//! whichever table crate the caller links (`nativeview-cli` passes `nativeview_tables::CORE_TABLE_DESCS`), so
//! this crate never depends on a table crate. Templates are checked by `rustc` at compile time.

pub mod flat_op;
pub mod java_host;
pub mod jni_frame;
pub mod layout;
pub mod model;
pub mod policy;
pub mod scene_facts;
pub mod shared_values;
pub mod spell;
pub mod tables;
pub mod top_layer_vectors;
mod validate;

pub use flat_op::{generate_flat_op_codec_files, generate_flat_op_codec_files_for_module};
pub use shared_values::{
    generate_shared_value_sets_c, generate_shared_value_sets_dart, generate_shared_value_sets_java,
    generate_shared_value_sets_swift, generate_shared_value_sets_ts,
};


use askama::Template;
use nativeview_abi::schema::{AbiFileDescriptor, core_abi_descriptor, runtime_abi_descriptor};
use nativeview_abi::table::{TableDesc, ValueSetDesc};

use crate::error::CodegenError;
use crate::schema::export::GeneratedFile;
use model::{AbiModel, HashVector, ModuleAbiModel, RuntimeAbiModel, hash_vectors};
use tables::{TableModel, merge_shared_value_sets, tables_model, value_sets, value_sets_with_core};
use jni_frame::JniFrameModel;
use spell::{c, dart, swift, ts};

const CORE: AbiFileDescriptor = core_abi_descriptor();
const RUNTIME: AbiFileDescriptor = runtime_abi_descriptor();

const CXX: &str = "packages/core/host-cxx";
const SWIFT: &str = "packages/core/host-swift";
const JAVA: &str = "packages/core/host-java/src";
const DART: &str = "packages/core/host-dart";
const TS: &str = "packages/core/host-ts";
const C_ABI_HEADER: &str = "packages/core/host-cxx/include/nv/generated/nv_abi.generated.h"; // under `CXX`
const C_RUNTIME_ABI_HEADER: &str =
    "packages/core/host-cxx/include/nv/generated/nv_runtime_abi.generated.h"; // under `CXX`
const C_WIRE_C11_CXX_HEADER: &str =
    "packages/core/host-cxx/include/nv/generated/nv_wire_c11.generated.h";

/// `nv_wire_c11.generated.h`: shared pure-C11 stack-first positional wire codec.
#[derive(Template)]
#[template(path = "c/nv_wire_c11.h", escape = "none")]
struct CWireC11;

/// Standalone capability-module C11 / C++20 ABI header generated from `#[derive(NvAbi)]` types.
#[derive(Template)]
#[template(path = "c/nv_module_abi.h", escape = "none")]
struct CModuleAbi<'a> {
    m: &'a ModuleAbiModel<'a>,
    guard: String,
}

/// Standalone capability-module Java ABI constants and enum codes generated from `#[derive(NvAbi)]`.
#[derive(Template)]
#[template(path = "java/NvModuleAbi.java", escape = "none")]
struct JavaModuleAbi<'a> {
    package: &'a str,
    class: &'a str,
    has_u64_const: bool,
    m: &'a ModuleAbiModel<'a>,
}

macro_rules! templates {
    ($($name:ident: $path:literal => $field:ident: $ty:ty;)*) => {$(
        #[derive(Template)]
        #[template(path = $path, escape = "none")]
        struct $name<'a> {
            $field: &'a $ty,
        }
    )*};
}

templates! {
    CAbi: "c/nv_abi.h" => m: AbiModel<'a>;
    CRuntimeAbi: "c/nv_runtime_abi.h" => m: RuntimeAbiModel<'a>;
    CVectors: "c/hash_vectors.h" => vectors: [HashVector];
    SwiftVectors: "swift/HashVectors.swift" => vectors: [HashVector];
    JavaAbi: "java/NvAbi.java" => m: AbiModel<'a>;
    JavaRuntimeAbi: "java/NvRuntimeAbi.java" => m: RuntimeAbiModel<'a>;
    JavaJniFrame: "java/NvJniFrame.java" => m: JniFrameModel;
    CxxJniFrame: "c/nv_jni_frame.hpp" => m: JniFrameModel;
    JavaVectors: "java/HashVectors.java" => vectors: [HashVector];
    DartAbiFfi: "dart/nv_abi_ffi.dart" => m: AbiModel<'a>;
    DartRuntimeAbi: "dart/nv_runtime_abi.dart" => m: RuntimeAbiModel<'a>;
    DartVectors: "dart/hash_vectors.dart" => vectors: [HashVector];
    TsVectors: "ts/hash_vectors.ts" => vectors: [HashVector];
}

/// `NvAbiConsts.generated.swift`: the Core and runtime scene constants of the pure-Swift reader.
#[derive(Template)]
#[template(path = "swift/NvAbiConsts.swift", escape = "none")]
struct SwiftAbiConsts<'a> {
    m: &'a AbiModel<'a>,
    rt: &'a RuntimeAbiModel<'a>,
}

/// `nv_abi_const.generated.dart`: the web-safe Core and runtime scene constants (the runtime
/// `SceneReader` runs on Dart-web too, so they never live in the `dart:ffi` runtime file).
#[derive(Template)]
#[template(path = "dart/nv_abi_const.dart", escape = "none")]
struct DartAbiConst<'a> {
    m: &'a AbiModel<'a>,
    rt: &'a RuntimeAbiModel<'a>,
}

/// `nv_abi.generated.ts`: the Core constants and records plus the runtime scene layout
/// (`NV_SCENE_LAYOUT_WASM32`) the TypeScript `SceneReader` reads.
#[derive(Template)]
#[template(path = "ts/nativeview_abi.ts", escape = "none")]
struct TsAbi<'a> {
    m: &'a AbiModel<'a>,
    rt: &'a RuntimeAbiModel<'a>,
}

/// The Core ABI model of the linked `nativeview-abi`.
pub fn abi_model() -> Result<AbiModel<'static>, CodegenError> {
    AbiModel::new(&CORE)
}

/// The runtime ABI model on top of `base` (`abi_model()`).
pub fn runtime_abi_model(base: &AbiModel<'static>) -> Result<RuntimeAbiModel<'static>, CodegenError> {
    RuntimeAbiModel::new(&RUNTIME, base)
}

/// Renders one template into a pre-sized buffer, ending in exactly one `\n` (Askama drops a
/// template's final newline). Output is LF-only by construction (asserted).
pub(crate) fn render(
    template: &dyn askama::DynTemplate,
    relative_path: String,
) -> Result<GeneratedFile, CodegenError> {
    render_with_cap(template, relative_path, 16 * 1024)
}

fn render_with_cap(
    template: &dyn askama::DynTemplate,
    relative_path: String,
    min_cap: usize,
) -> Result<GeneratedFile, CodegenError> {
    let mut content = String::with_capacity(template.size_hint().max(min_cap));
    template
        .dyn_render_into(&mut content)
        .map_err(|e| CodegenError::validation(format!("rendering {relative_path}: {e}")))?;
    content.push('\n');
    if content.contains('\r') {
        return Err(CodegenError::validation(format!(
            "{relative_path} contains a carriage return"
        )));
    }
    Ok(GeneratedFile {
        relative_path,
        content,
    })
}

/// `nv_abi.generated.h`: the merged C ABI header every C / C++ / Objective-C / Swift host imports.
pub fn generate_c_abi_header() -> Result<String, CodegenError> {
    let m = abi_model()?;
    Ok(render_with_cap(&CAbi { m: &m }, C_ABI_HEADER.to_owned(), 64 * 1024)?.content)
}

/// Renders a standalone capability-module C11 / C++20 ABI header from a `#[derive(NvAbi)]`
/// [`AbiFileDescriptor`], with cross-data-model `NV_STATIC_ASSERT` layout locks.
pub fn generate_module_c_abi_header(
    desc: &AbiFileDescriptor,
    stem: &str,
    relative_path: String,
) -> Result<GeneratedFile, CodegenError> {
    let m = ModuleAbiModel::new(desc)?;
    let guard = format!("NV_{}_ABI_GENERATED_H", spell::screaming(stem));
    render(&CModuleAbi { m: &m, guard }, relative_path)
}

/// Renders a standalone capability-module Java ABI constants/enum class from a `#[derive(NvAbi)]`
/// [`AbiFileDescriptor`].
pub fn generate_module_java_abi_file(
    package: &str,
    class: &str,
    desc: &AbiFileDescriptor,
    relative_path: String,
) -> Result<GeneratedFile, CodegenError> {
    let m = ModuleAbiModel::new(desc)?;
    let has_u64_const = m.consts().any(|k| k.ty == "u64");
    render(&JavaModuleAbi { package, class, has_u64_const, m: &m }, relative_path)
}

/// Renders the C runtime ABI header for an arbitrary validated [`RuntimeAbiModel`].
pub fn render_c_runtime_abi(m: &RuntimeAbiModel<'_>) -> Result<String, CodegenError> {
    Ok(render(&CRuntimeAbi { m }, C_RUNTIME_ABI_HEADER.to_owned())?.content)
}

/// Renders the Dart runtime ABI bindings for an arbitrary validated [`RuntimeAbiModel`].
pub fn render_dart_runtime_abi(m: &RuntimeAbiModel<'_>) -> Result<String, CodegenError> {
    Ok(render(
        &DartRuntimeAbi { m },
        format!("{DART}/lib/src/generated/nv_runtime_abi.generated.dart"),
    )?
    .content)
}

/// Every Core ABI file (C, Swift constants, Java, Dart const + `dart:ffi`, TypeScript), the C
/// runtime ABI header, and the five scene-fact readers.
pub fn generate_abi_files() -> Result<Vec<GeneratedFile>, CodegenError> {
    let m = abi_model()?;
    let runtime = runtime_abi_model(&m)?;
    let jni = JniFrameModel::new();
    let mut files = vec![
        render_with_cap(&CAbi { m: &m }, C_ABI_HEADER.to_owned(), 64 * 1024)?,
        render(&CRuntimeAbi { m: &runtime }, C_RUNTIME_ABI_HEADER.to_owned())?,
        render(&CWireC11, C_WIRE_C11_CXX_HEADER.to_owned())?,
        render(
            &SwiftAbiConsts { m: &m, rt: &runtime },
            format!("{SWIFT}/Sources/NativeViewHost/NvAbiConsts.generated.swift"),
        )?,
        render(
            &JavaAbi { m: &m },
            format!("{JAVA}/main/java/io/github/nativeview/host/generated/NvAbi.java"),
        )?,
        render(
            &JavaRuntimeAbi { m: &runtime },
            format!("{JAVA}/main/java/io/github/nativeview/host/generated/NvRuntimeAbi.java"),
        )?,
        render(
            &JavaJniFrame { m: &jni },
            format!("{JAVA}/main/java/io/github/nativeview/host/generated/NvJniFrame.java"),
        )?,
        render(
            &CxxJniFrame { m: &jni },
            format!("{CXX}/include/nv/generated/nv_jni_frame.generated.hpp"),
        )?,
        render(
            &DartAbiConst { m: &m, rt: &runtime },
            format!("{DART}/lib/src/generated/nv_abi_const.generated.dart"),
        )?,
        render(
            &DartAbiFfi { m: &m },
            format!("{DART}/lib/src/generated/nv_abi_ffi.generated.dart"),
        )?,
        render(
            &DartRuntimeAbi { m: &runtime },
            format!("{DART}/lib/src/generated/nv_runtime_abi.generated.dart"),
        )?,
        render(
            &TsAbi { m: &m, rt: &runtime },
            format!("{TS}/src/generated/nv_abi.generated.ts"),
        )?,
    ];
    files.extend(scene_facts::generate_scene_fact_files()?);
    Ok(files)
}

/// The C11 / C++20 table header: the core one (`module: None`, adds `NV_TABLE_COUNT` /
/// `NV_TABLE_LIST`) or a capability module's (`NV_<MODULE>_TABLES_GENERATED_H`).
#[derive(Template)]
#[template(path = "c/nv_tables.h", escape = "none")]
struct CTables<'a> {
    tables: &'a [TableModel<'a>],
    value_sets: &'a [&'static ValueSetDesc],
    guard: String,
    table_word: &'a str,
    core: bool,
}

impl<'a> CTables<'a> {
    fn new(
        tables: &'a [TableModel<'a>],
        value_sets: &'a [&'static ValueSetDesc],
        module: Option<&str>,
    ) -> Self {
        let guard = match module {
            Some(m) => format!("NV_{}_TABLES_GENERATED_H", spell::screaming(m)),
            None => "NV_TABLES_GENERATED_H".to_owned(),
        };
        let table_word = if module.is_some() { "<nv/host/table_word.h>" } else { "\"../host/table_word.h\"" };
        Self { tables, value_sets, guard, table_word, core: module.is_none() }
    }
}

/// Swift table mirror: field specs plus one `Nv<Set>` enum (variants) or namespace (flags) per
/// value set (or nested under `Values` for per-module mirrors).
#[derive(Template)]
#[template(path = "swift/NvTables.swift", escape = "none")]
struct SwiftTables<'a> {
    namespace: &'a str,
    core: bool,
    import_host: bool,
    nest_value_sets: bool,
    tables: &'a [TableModel<'a>],
    value_sets: &'a [&'static ValueSetDesc],
}

/// Java word-table mirror (`NvTables`, `NvModuleTables`, or per-module `Nv<Mod>Tables`): field
/// specs, default rows, `Info` / `all()`, and one `Values.<Set>` class per value set.
#[derive(Template)]
#[template(path = "java/NvTables.java", escape = "none")]
pub(crate) struct JavaTables<'a> {
    pub(crate) package: &'a str,
    pub(crate) class: &'a str,
    pub(crate) doc: &'a str,
    pub(crate) tables: &'a [TableModel<'a>],
    pub(crate) value_sets: &'a [&'static ValueSetDesc],
}

/// Dart word-table mirror: field specs plus one `Nv<Set>` constant class per value set.
#[derive(Template)]
#[template(path = "dart/nativeview_tables.dart", escape = "none")]
struct DartTables<'a> {
    core: bool,
    namespace: &'a str,
    list_name: &'a str,
    tables: &'a [TableModel<'a>],
    value_sets: &'a [&'static ValueSetDesc],
}

/// TypeScript word-table mirror (core `host-ts` or per-module leaf importing `@nativeview/host`).
#[derive(Template)]
#[template(path = "ts/nativeview_tables.ts", escape = "none")]
struct TsTables<'a> {
    core: bool,
    list_name: &'a str,
    tables: &'a [TableModel<'a>],
    value_sets: &'a [&'static ValueSetDesc],
}

/// Field specs, keys, schema hashes, and named field values of `tables` for every host runtime.
pub fn generate_table_files(tables: &[&TableDesc]) -> Result<Vec<GeneratedFile>, CodegenError> {
    let t = tables_model(tables)?;
    let sets = value_sets(&t)?;
    let tables = t.as_slice();
    Ok(vec![
        render(
            &CTables::new(tables, &sets, None),
            format!("{CXX}/include/nv/generated/nv_tables.generated.h"),
        )?,
        render(
            &SwiftTables {
                namespace: "NvTables",
                core: true,
                import_host: false,
                nest_value_sets: false,
                tables,
                value_sets: &sets,
            },
            format!("{SWIFT}/Sources/NativeViewHost/NvTables.generated.swift"),
        )?,
        render(
            &JavaTables {
                package: "io.github.nativeview.host.generated",
                class: "NvTables",
                doc: "Word-table keys, schema hashes, default rows, field specs, and value sets for {@code TableReader}.",
                tables,
                value_sets: &sets,
            },
            format!("{JAVA}/main/java/io/github/nativeview/host/generated/NvTables.java"),
        )?,
        render(
            &DartTables {
                core: true,
                namespace: "",
                list_name: "nvTables",
                tables,
                value_sets: &sets,
            },
            format!("{DART}/lib/src/generated/nv_tables.generated.dart"),
        )?,
        render(
            &TsTables {
                core: true,
                list_name: "NV_TABLES",
                tables,
                value_sets: &[],
            },
            format!("{TS}/src/generated/nv_tables.generated.ts"),
        )?,
    ])
}

/// Upfront cross-check of all registered cross-module shared value sets against core table value
/// sets (rejects conflicting redefinitions or C constant collisions before any file is emitted).
pub fn validate_merged_shared_value_sets(
    core_tables: &[&TableDesc],
    shared_sets: &[&'static ValueSetDesc],
) -> Result<(), CodegenError> {
    let core_models = tables_model(core_tables)?;
    let core_sets = value_sets(&core_models)?;
    let _ = merge_shared_value_sets(&core_sets, shared_sets)?;
    Ok(())
}

pub(crate) fn module_value_sets(
    tables: &[TableModel<'_>],
    core_tables: &[&TableDesc],
    shared_sets: &[&'static ValueSetDesc],
    omit_shared: bool,
) -> Result<Vec<&'static ValueSetDesc>, CodegenError> {
    let core_models = tables_model(core_tables)?;
    let core_sets = value_sets(&core_models)?;
    let merged = merge_shared_value_sets(&core_sets, shared_sets)?;
    value_sets_with_core(tables, &merged, omit_shared)
}

/// The C11 / C++20 mirror of a capability module's tables (`module` = `canvas` ->
/// `NV_CANVAS_TABLES_GENERATED_H`, includes `<nv/host/table_word.h>` from `nv::host_cxx`).
/// The caller links the module and passes its descriptors plus `core_tables` and `shared_sets`
/// (for cross-check against core and cross-module `WordEnum` value sets), so this crate stays
/// module-free.
pub fn generate_module_table_header(
    module: &str,
    tables: &[&TableDesc],
    core_tables: &[&TableDesc],
    shared_sets: &[&'static ValueSetDesc],
    relative_path: String,
) -> Result<GeneratedFile, CodegenError> {
    let t = tables_model(tables)?;
    let sets = module_value_sets(&t, core_tables, shared_sets, false)?;
    render(&CTables::new(&t, &sets, Some(module)), relative_path)
}

/// Per-module Swift table mirror (`Nv<Mod>Tables.generated.swift`) living in the module's own
/// Swift target (`import NativeViewHost`, value sets nested under `Values` to avoid collisions).
pub fn generate_swift_module_table_file(
    namespace: &str,
    tables: &[&TableDesc],
    core_tables: &[&TableDesc],
    shared_sets: &[&'static ValueSetDesc],
    relative_path: String,
) -> Result<GeneratedFile, CodegenError> {
    let t = tables_model(tables)?;
    let sets = module_value_sets(&t, core_tables, shared_sets, true)?;
    render(
        &SwiftTables {
            namespace,
            core: false,
            import_host: true,
            nest_value_sets: true,
            tables: &t,
            value_sets: &sets,
        },
        relative_path,
    )
}

/// Per-module Java table mirror (`<package>.Nv<Mod>Tables`) living in the module's Android leaf.
pub fn generate_java_module_table_file(
    package: &str,
    class: &str,
    tables: &[&TableDesc],
    core_tables: &[&TableDesc],
    shared_sets: &[&'static ValueSetDesc],
    relative_path: String,
) -> Result<GeneratedFile, CodegenError> {
    let t = tables_model(tables)?;
    let sets = module_value_sets(&t, core_tables, shared_sets, true)?;
    render(
        &JavaTables {
            package,
            class,
            doc: "Published capability-module word tables (same shape as {@code NvTables}).",
            tables: &t,
            value_sets: &sets,
        },
        relative_path,
    )
}

/// Per-module Dart table mirror (`nv_<stem>_tables.generated.dart`) importing `package:nativeview_host`.
pub fn generate_dart_module_table_file(
    namespace: &str,
    list_name: &str,
    tables: &[&TableDesc],
    core_tables: &[&TableDesc],
    shared_sets: &[&'static ValueSetDesc],
    relative_path: String,
) -> Result<GeneratedFile, CodegenError> {
    let t = tables_model(tables)?;
    let sets = module_value_sets(&t, core_tables, shared_sets, true)?;
    render(
        &DartTables {
            core: false,
            namespace,
            list_name,
            tables: &t,
            value_sets: &sets,
        },
        relative_path,
    )
}

/// Per-module TypeScript table mirror (`nv_<stem>_tables.generated.ts`) importing `@nativeview/host`.
pub fn generate_ts_module_table_file(
    list_name: &str,
    tables: &[&TableDesc],
    core_tables: &[&TableDesc],
    shared_sets: &[&'static ValueSetDesc],
    relative_path: String,
) -> Result<GeneratedFile, CodegenError> {
    let t = tables_model(tables)?;
    let sets = module_value_sets(&t, core_tables, shared_sets, true)?;
    render(
        &TsTables {
            core: false,
            list_name,
            tables: &t,
            value_sets: &sets,
        },
        relative_path,
    )
}


/// The golden XXH64 vectors for every host runtime's test suite.
pub fn generate_hash_vector_files() -> Result<Vec<GeneratedFile>, CodegenError> {
    let v = hash_vectors();
    let vectors = v.as_slice();
    Ok(vec![
        render(
            &CVectors { vectors },
            format!("{CXX}/tests/hash_vectors.generated.h"),
        )?,
        render(
            &SwiftVectors { vectors },
            format!("{SWIFT}/Tests/NativeViewHostTests/HashVectors.generated.swift"),
        )?,
        render(
            &JavaVectors { vectors },
            format!("{JAVA}/test/java/io/github/nativeview/host/generated/HashVectors.java"),
        )?,
        render(
            &DartVectors { vectors },
            format!("{DART}/test/src/hash_vectors.generated.dart"),
        )?,
        render(
            &TsVectors { vectors },
            format!("{TS}/test/hash_vectors.generated.ts"),
        )?,
    ])
}

/// Every generated host file: ABI, `tables`, and the golden XXH64 vectors.
pub fn generate_all_abi_files(tables: &[&TableDesc]) -> Result<Vec<GeneratedFile>, CodegenError> {
    let mut files = generate_abi_files()?;
    files.extend(generate_table_files(tables)?);
    files.extend(generate_hash_vector_files()?);
    Ok(files)
}