Skip to content

Commit 80a95bd

Browse files
committed
chore: synchronize local changes for Neuron LLM app
1 parent 1aa628e commit 80a95bd

54 files changed

Lines changed: 2987 additions & 374 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/build.gradle.kts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ plugins {
1010
android {
1111
namespace = "com.tryptz.neuron"
1212
compileSdk = 36
13+
// AGP 8.7.3's default NDK (27.x) is not installed; pin to an available one.
14+
ndkVersion = "29.0.14206865"
1315

1416
defaultConfig {
1517
applicationId = "com.tryptz.neuron"
@@ -21,8 +23,12 @@ android {
2123
ndk { abiFilters += listOf("arm64-v8a") }
2224
externalNativeBuild {
2325
cmake {
24-
arguments("-DANDROID_STL=c++_shared", "-DLLAMA_VULKAN=ON", "-DLLAMA_QNN=OFF")
25-
cppFlags("-std=c++20", "-O3", "-ffast-math")
26+
// CPU-only first build — proven path on aarch64+proot.
27+
// Flip LLAMA_VULKAN to ON to chase Adreno GPU speedups once CPU works.
28+
arguments("-DANDROID_STL=c++_shared", "-DLLAMA_VULKAN=OFF", "-DLLAMA_QNN=OFF")
29+
// -ffast-math implies -ffinite-math-only, which ggml's vec.h rejects
30+
// (llama.cpp PR #7154). Override just that sub-flag while keeping the rest.
31+
cppFlags("-std=c++20", "-O3", "-ffast-math", "-fno-finite-math-only")
2632
}
2733
}
2834
}
@@ -58,6 +64,12 @@ composeCompiler {
5864
stabilityConfigurationFile = rootProject.layout.projectDirectory.file("compose_stability.conf")
5965
}
6066

67+
// Export the Room schema JSON on every build so migrations can diff against it.
68+
// Generated files land in app/schemas/<db-class-fqcn>/<version>.json and must be committed.
69+
ksp {
70+
arg("room.schemaLocation", "$projectDir/schemas")
71+
}
72+
6173
dependencies {
6274
implementation(platform(libs.compose.bom))
6375
implementation(libs.compose.ui)
2.74 MB
Binary file not shown.

app/schemas/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Room schemas
2+
3+
This directory holds the exported Room schema JSON for `NeuronDatabase`.
4+
5+
## How it works
6+
7+
`app/build.gradle.kts` sets `ksp { arg("room.schemaLocation", "$projectDir/schemas") }`,
8+
so Room's annotation processor writes a schema file **on every build** to:
9+
10+
```
11+
app/schemas/com.tryptz.neuron.data.local.NeuronDatabase/<version>.json
12+
```
13+
14+
For the current schema (`version = 3`) that is:
15+
16+
```
17+
app/schemas/com.tryptz.neuron.data.local.NeuronDatabase/3.json
18+
```
19+
20+
The directory is empty until the project is built once with an Android SDK present.
21+
That is expected — the JSON cannot be hand-written or fabricated; it is generated.
22+
23+
## What you must do
24+
25+
1. After the first successful build, **commit the generated `3.json`**
26+
(and `2.json` if any build still emits it) so `MIGRATION_2_3` has a schema to verify against.
27+
2. Whenever you change an `@Entity` (new column, table, index, etc.):
28+
- bump `version` in `NeuronDatabase`,
29+
- add a `Migration` to `NeuronDatabase.MIGRATIONS`,
30+
- build (Room exports the new `<version>.json` and validates the migration
31+
against the previously committed schema),
32+
- commit the new schema JSON alongside the migration.
33+
34+
Keeping these JSON files in version control is what lets Room verify that each
35+
migration actually produces the expected schema.

0 commit comments

Comments
 (0)