Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ asmlift: [score] unsigned: 0 (match)

## Layout (pnpm workspace monorepo)

| Package / app | What it is |
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [`packages/core`](packages/core/README.md) ([`@asmlift/core`](https://www.npmjs.com/package/@asmlift/core)) | The decompile pipeline |
| [`packages/cli`](packages/cli/README.md) ([`@asmlift/cli`](https://www.npmjs.com/package/@asmlift/cli)) | The user-facing CLI package |
| [`packages/toolchains`](packages/toolchains/README.md) | The pinned calibration toolchains. Used only for the tests and benchmark |
| `packages/bench-schema` | The shared benchmark result/manifest schema types |
| [`apps/web`](apps/web/README.md) | The webapp including the **Playground** and the **Benchmark** |
| [`apps/benchmark`](apps/benchmark/README.md) | The asmlift and m2c harness |
| Package / app | What it is |
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| [`packages/core`](packages/core/README.md) ([`@asmlift/core`](https://www.npmjs.com/package/@asmlift/core)) | The decompile pipeline |
| [`packages/cli`](packages/cli/README.md) ([`@asmlift/cli`](https://www.npmjs.com/package/@asmlift/cli)) | The user-facing CLI package |
| [`packages/toolchains`](packages/toolchains/README.md) | The pinned calibration toolchains. Used only for the tests and benchmark |
| [`packages/bench-schema`](packages/bench-schema/README.md) | The shared benchmark contract: result/manifest types + feature vocabulary |
| [`apps/web`](apps/web/README.md) | The webapp including the **Playground** and the **Benchmark** |
| [`apps/benchmark`](apps/benchmark/README.md) | The asmlift and m2c harness |

## License

Expand Down
10 changes: 7 additions & 3 deletions apps/benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,10 @@ Host prerequisites (macOS; verified empirically):
| `decomp-config.ts` | candidate compilation through the real `decomp.yaml` user path |
| `cache.ts` | content-keyed result cache (tmp-then-rename; m2c dirty-checkout fail-closed; versioned key) |

The result schema is `@asmlift/bench-schema` (types-only workspace package) — the ONE definition
this harness produces and the web Benchmark view consumes. The harness's own toolchain-free tests
live in `test/` and run in CI.
The result schema is [`@asmlift/bench-schema`](../../packages/bench-schema/README.md) — the ONE
definition this harness produces and the web Benchmark view consumes, including the closed feature
vocabulary every row's `features` is drawn from. The harness's own toolchain-free tests live in
`test/` and run in CI.

## Extending

Expand All @@ -188,6 +189,9 @@ live in `test/` and run in CI.
until they compile; then `pnpm bench run` + `pnpm bench:merge`.
- **Add a toolchain**: an adapter in `toolchains.ts` + a `compile/<name>.ts` module for the real
tier (or a typed `null` while unwired — see `compile/mwcc.ts`).
- **Tag a function**: list only judgement tags (`memory`, `struct`, …) — the source- and
codegen-evidenced ones are derived per row. See
[`@asmlift/bench-schema`](../../packages/bench-schema/README.md).
- Re-run and re-merge; the Benchmark view re-renders from the committed `results.json`.

## Committed artifacts
Expand Down
18 changes: 4 additions & 14 deletions apps/benchmark/dataset/real/af.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
{
"sym": "mem_copy",
"features": [
"loop",
"pointer",
"memory"
],
Expand All @@ -52,7 +51,6 @@
{
"sym": "mem_clear",
"features": [
"loop",
"pointer",
"memory"
],
Expand All @@ -68,7 +66,6 @@
{
"sym": "mem_cmp",
"features": [
"loop",
"pointer",
"branch"
],
Expand Down Expand Up @@ -297,8 +294,7 @@
"features": [
"array",
"arithmetic",
"branch",
"shift"
"branch"
],
"prependC": "typedef unsigned char u8;\ntypedef unsigned short u16;\ntypedef int s32;\n#define UNUSED\nextern u8 mRmTp_ftr_size[];",
"funcC": "s32 mRmTp_ItemNo2FtrSize(u16 name) {\n if (name >= 0x1000 && name < 0x1ECD) {\n UNUSED s32 scoped;\n return mRmTp_ftr_size[(name - 0x1000) >> 2];\n }\n return 0;\n}",
Expand Down Expand Up @@ -330,8 +326,7 @@
"sym": "chase_f3",
"features": [
"float",
"branch",
"ternary"
"branch"
],
"prependC": "typedef int s32;\ntypedef float f32;",
"funcC": "s32 chase_f3(f32* pValue, f32 target, f32 incrStep, f32 decrStep) {\n f32 step = (target >= *pValue) ? incrStep : decrStep;\n\n if (step != 0.0f) {\n if (target < *pValue) {\n step = -step;\n }\n\n *pValue += step;\n\n if (((*pValue - target) * step) >= 0) {\n *pValue = target;\n return 1;\n }\n } else if (target == *pValue) {\n return 1;\n }\n\n return 0;\n}",
Expand Down Expand Up @@ -417,11 +412,9 @@
"features": [
"union",
"array",
"shift",
"cast",
"pointer",
"float",
"bitwise"
"float"
],
"funcC": "Mtx* _MtxF_to_Mtx(MtxF* src, Mtx* dest) {\n s32 fp;\n u16* intPart = (u16*)&dest->m[0][0];\n u16* fracPart = (u16*)&dest->m[2][0];\n\n fp = src->xx * 0x10000;\n intPart[0] = (fp >> 0x10);\n fracPart[0] = fp & 0xFFFF;\n\n fp = src->yx * 0x10000;\n intPart[1] = (fp >> 0x10);\n fracPart[1] = fp & 0xFFFF;\n\n fp = src->zx * 0x10000;\n intPart[2] = (fp >> 0x10);\n fracPart[2] = fp & 0xFFFF;\n\n fp = src->wx * 0x10000;\n intPart[3] = (fp >> 0x10);\n fracPart[3] = fp & 0xFFFF;\n\n fp = src->xy * 0x10000;\n intPart[4] = (fp >> 0x10);\n fracPart[4] = fp & 0xFFFF;\n\n fp = src->yy * 0x10000;\n intPart[5] = (fp >> 0x10);\n fracPart[5] = fp & 0xFFFF;\n\n // Ideally these three would use fracPart instead of intPart, but it's required to match.\n fp = src->zy * 0x10000;\n intPart[6] = (fp >> 0x10);\n intPart[22] = fp & 0xFFFF;\n\n fp = src->wy * 0x10000;\n intPart[7] = (fp >> 0x10);\n intPart[23] = fp & 0xFFFF;\n\n fp = src->xz * 0x10000;\n intPart[8] = (fp >> 0x10);\n intPart[24] = fp & 0xFFFF;\n\n fp = src->yz * 0x10000;\n intPart[9] = (fp >> 0x10);\n fracPart[9] = fp & 0xFFFF;\n\n fp = src->zz * 0x10000;\n intPart[10] = (fp >> 0x10);\n fracPart[10] = fp & 0xFFFF;\n\n fp = src->wz * 0x10000;\n intPart[11] = (fp >> 0x10);\n fracPart[11] = fp & 0xFFFF;\n\n fp = src->xw * 0x10000;\n intPart[12] = (fp >> 0x10);\n fracPart[12] = fp & 0xFFFF;\n\n fp = src->yw * 0x10000;\n intPart[13] = (fp >> 0x10);\n fracPart[13] = fp & 0xFFFF;\n\n fp = src->zw * 0x10000;\n intPart[14] = (fp >> 0x10);\n fracPart[14] = fp & 0xFFFF;\n\n fp = src->ww * 0x10000;\n intPart[15] = (fp >> 0x10);\n fracPart[15] = fp & 0xFFFF;\n return dest;\n}",
"prependC": "typedef unsigned char u8; /* unsigned 8-bit */\ntypedef unsigned short u16; /* unsigned 16-bit */\ntypedef unsigned long u32; /* unsigned 32-bit */\ntypedef unsigned long long u64; /* unsigned 64-bit */\ntypedef signed char s8; /* signed 8-bit */\ntypedef short s16; /* signed 16-bit */\ntypedef long s32; /* signed 32-bit */\ntypedef long long s64; /* signed 64-bit */\ntypedef float f32; /* single prec floating point */\ntypedef double f64; /* double prec floating point */\ntypedef struct xyz_t {\n /* 0x0 */ f32 x;\n /* 0x4 */ f32 y;\n /* 0x8 */ f32 z;\n} xyz_t; // size = 0xC\n\ntypedef float MtxF_t[4][4];\ntypedef union {\n MtxF_t mf;\n struct {\n float xx, yx, zx, wx, xy, yy, zy, wy, xz, yz, zz, wz, xw, yw, zw, ww;\n };\n} MtxF; // size = 0x40\ntypedef long\tMtx_t[4][4];\n\ntypedef union {\n Mtx_t\t\tm;\n long long int\tforce_structure_alignment;\n} Mtx;",
Expand All @@ -432,9 +425,7 @@
"features": [
"float",
"array",
"shift",
"matrix",
"bitwise"
"matrix"
],
"funcC": "void suMtxMakeSRT(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, s16 rotX, s16 rotY, s16 rotZ, f32 translateX,\n f32 translateY, f32 translateZ) {\n struct {\n s16 intPart[4][4];\n u16 fracPart[4][4];\n }* mu = (void*)mtx;\n s32 fp;\n f32 sinX = sin_s(rotX);\n f32 sinY = sin_s(rotY);\n f32 sinZ = sin_s(rotZ);\n f32 cosX = cos_s(rotX);\n f32 cosY = cos_s(rotY);\n f32 cosZ = cos_s(rotZ);\n\n fp = cosY * cosZ * scaleX * 0x10000;\n mu->intPart[0][0] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[0][0] = fp & 0xFFFF;\n\n fp = cosY * sinZ * scaleX * 0x10000;\n mu->intPart[0][1] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[0][1] = fp & 0xFFFF;\n\n fp = -sinY * scaleX * 0x10000;\n mu->intPart[0][2] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[0][2] = fp & 0xFFFF;\n\n fp = ((sinX * sinY * cosZ) - (cosX * sinZ)) * scaleY * 0x10000;\n mu->intPart[1][0] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[1][0] = fp & 0xFFFF;\n\n fp = ((sinX * sinY * sinZ) + (cosX * cosZ)) * scaleY * 0x10000;\n mu->intPart[1][1] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[1][1] = fp & 0xFFFF;\n\n fp = sinX * cosY * scaleY * 0x10000;\n mu->intPart[1][2] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[1][2] = fp & 0xFFFF;\n\n fp = ((cosX * sinY * cosZ) + (sinX * sinZ)) * scaleZ * 0x10000;\n mu->intPart[2][0] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[2][0] = fp & 0xFFFF;\n\n fp = ((cosX * sinY * sinZ) - (sinX * cosZ)) * scaleZ * 0x10000;\n mu->intPart[2][1] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[2][1] = fp & 0xFFFF;\n\n fp = cosX * cosY * scaleZ * 0x10000;\n mu->intPart[2][2] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[2][2] = fp & 0xFFFF;\n\n fp = translateX * 0x10000;\n mu->intPart[3][0] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[3][0] = fp & 0xFFFF;\n\n fp = translateY * 0x10000;\n mu->intPart[3][1] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[3][1] = fp & 0xFFFF;\n\n fp = translateZ * 0x10000;\n mu->intPart[3][2] = ((u32)fp >> 0x10) & 0xFFFF;\n mu->fracPart[3][2] = fp & 0xFFFF;\n\n mu->intPart[0][3] = mu->intPart[1][3] = mu->intPart[2][3] = 0;\n mu->fracPart[0][3] = mu->fracPart[1][3] = mu->fracPart[2][3] = 0;\n mu->intPart[3][3] = 1;\n mu->fracPart[3][3] = 0;\n}",
"prependC": "typedef unsigned char u8; /* unsigned 8-bit */\ntypedef unsigned short u16; /* unsigned 16-bit */\ntypedef unsigned long u32; /* unsigned 32-bit */\ntypedef unsigned long long u64; /* unsigned 64-bit */\ntypedef signed char s8; /* signed 8-bit */\ntypedef short s16; /* signed 16-bit */\ntypedef long s32; /* signed 32-bit */\ntypedef long long s64; /* signed 64-bit */\ntypedef float f32; /* single prec floating point */\ntypedef double f64; /* double prec floating point */\ntypedef struct xyz_t {\n /* 0x0 */ f32 x;\n /* 0x4 */ f32 y;\n /* 0x8 */ f32 z;\n} xyz_t; // size = 0xC\n\ntypedef float MtxF_t[4][4];\ntypedef union {\n MtxF_t mf;\n struct {\n float xx, yx, zx, wx, xy, yy, zy, wy, xz, yz, zz, wz, xw, yw, zw, ww;\n };\n} MtxF; // size = 0x40\ntypedef long\tMtx_t[4][4];\n\ntypedef union {\n Mtx_t\t\tm;\n long long int\tforce_structure_alignment;\n} Mtx;",
Expand All @@ -448,7 +439,6 @@
{
"sym": "sAdo_Get_KokeruLabel",
"features": [
"switch",
"branch"
],
"funcC": "s32 sAdo_Get_KokeruLabel(s32 type) {\n u16 label = sAdo_Get_WalkLabel(type);\n s32 ret;\n\n switch (label) {\n case 0x201:\n ret = 0xe;\n break;\n\n case 0x206:\n ret = 0x13;\n break;\n\n case 0x202:\n ret = 0xf;\n break;\n\n case 0x203:\n ret = 0x10;\n break;\n\n case 0x204:\n ret = 0x11;\n break;\n\n case 0x205:\n ret = 0x12;\n break;\n\n case 0x208:\n ret = 0x156;\n break;\n\n case 0x209:\n ret = 0x157;\n break;\n\n default:\n ret = 15;\n break;\n }\n return ret;\n}",
Expand Down
Loading
Loading