Документацію написано англійською.
AIR corpus report
What every module of the system's Metal libraries does when put through the
frontend. Generated by tools/air/corpus.py; see docs/air.md section 5 for
what the stages mean. Reaching ir3 means it compiled, not that it is
correct: correctness needs the CPU reference and a run on the GPU.
Stages
| stage | modules | of 456 |
|---|---|---|
| container | 456 | 100% |
| reader | 456 | 100% |
| translate | 321 | 70% |
| ir3 | 321 | 70% |
By stage of the shader
| what the module is | modules | translate | ir3 |
|---|---|---|---|
| fragment | 271 | 271 | 271 |
| kernel | 47 | 47 | 47 |
| vertex | 3 | 3 | 3 |
| visible | 135 | 0 | 0 |
The container's TYPE tag agrees with the module's own metadata on 456 of 456; 0 disagree.
By library
| library | modules | translate | ir3 |
|---|---|---|---|
| AppleMetalGLRenderer.bundle/default.metallib | 274 | 274 | 274 |
| PortraitFilters.cifilter/default.metallib | 36 | 36 | 36 |
| PortraitFilters.cifilter/portrait_filters.metallib | 135 | 0 | 0 |
| VideoDecoders/AV1SW.metallib | 11 | 11 | 11 |
Modules that call no air.* at all
283 of 456 (62%), of which 262 translate and 262 compile through ir3.
What is not handled yet, by how many modules it stops
| modules | where it stops |
|---|---|
| 135 | stage: air.visible, a library function (not yet) |
The air.* functions the corpus calls
119 distinct names in 173 modules.
| calls | name |
|---|---|
| 50 | air.fast_clamp.f32 |
| 45 | air.mix.v3f32 |
| 36 | air.dot.v3f32 |
| 27 | air.fast_fmin.v3f32 |
| 27 | air.fast_exp.f32 |
| 26 | air.fast_fmax.f32 |
| 23 | air.fast_sqrt.f32 |
| 21 | air.fast_clamp.v3f32 |
| 20 | air.fast_fmax.v3f32 |
| 19 | air.fast_fmin.f32 |
| 16 | air.fast_clamp.v4f32 |
| 15 | air.fast_pow.v3f32 |
| 15 | air.fast_pow.f32 |
| 14 | air.get_height_texture_2d |
| 14 | air.get_width_texture_2d |
| 13 | air.mix.v4f32 |
| 12 | air.sample_texture_2d.v4f32 |
| 12 | air.convert.f.f32.s.i32 |
| 10 | air.read_texture_2d.u.v4i16 |
| 9 | air.write_texture_2d.v4f16 |
| 8 | air.convert.f.f32.u.i32 |
| 8 | air.mix.f32 |
| 7 | air.write_texture_3d.v4f16 |
| 7 | air.sample_texture_3d.v4f16 |
| 7 | air.fast_sqrt.v3f32 |
| 7 | air.fast_pow.v4f32 |
| 7 | air.fast_sqrt.v4f32 |
| 6 | air.write_texture_2d.u.v4i16 |
| 6 | air.convert.u.v2i32.f.v2f32 |
| 6 | air.fast_floor.v2f32 |
| 6 | air.convert.f.v3f32.u.v3i32 |
| 5 | air.atomic.global.store.i32 |
| 5 | air.convert.s.i32.f.f32 |
| 5 | air.fast_fabs.v3f32 |
| 5 | air.sign.v3f32 |
| 5 | air.convert.f.f32.u.i1 |
| 4 | air.convert.f.f16.u.i32 |
| 4 | air.convert.f.f16.s.i32 |
| 4 | air.min.u.i16 |
| 4 | air.read_texture_2d.s.v4i16 |
| 4 | air.get_num_samples_texture_2d_ms |
| 4 | air.dot.v4f32 |
| 4 | air.read_texture_2d.v4f32 |
| 4 | air.convert.u.i32.f.f32 |
| 4 | air.dot.v2f32 |
| 4 | air.wg.barrier |
| 4 | air.write_texture_2d.i16.v4f32 |
| 4 | air.fast_fmax.v4f32 |
| 4 | air.fast_atan2.f32 |
| 4 | air.fast_fabs.f32 |
| 3 | air.saturate.f16 |
| 3 | air.atomic.global.add.s.i32 |
| 3 | air.read_texture_2d.i16.v4f32 |
| 3 | air.atomic.global.add.u.i32 |
| 3 | air.fast_ldexp.f32 |
| 3 | air.fast_sin.f32 |
| 3 | air.fast_cos.f32 |
| 2 | air.clamp.s.i32 |
| 2 | air.clamp.s.i16 |
| 2 | air.clamp.s.v2i16 |
| 2 | air.convert.u.v2i16.s.v2i32 |
| 2 | air.clamp.s.v2i32 |
| 2 | air.convert.s.v2i32.u.v2i16 |
| 2 | air.convert.s.v2i16.s.v2i32 |
| 2 | air.convert.s.v2i32.s.v2i16 |
| 2 | air.read_texture_2d_ms.v4f32 |
| 2 | air.fmin.f32 |
| 2 | air.floor.f32 |
| 2 | air.fast_fract.f32 |
| 2 | air.sample_texture_3d.v4f32 |
| 2 | air.atomic.global.max.s.i32 |
| 2 | air.atomic.global.min.s.i32 |
| 2 | air.max.s.i32 |
| 2 | air.min.s.i32 |
| 2 | air.all.v3i1 |
| 2 | air.fast_round.f32 |
| 2 | air.atomic.global.load.i32 |
| 2 | air.all.v2i1 |
| 2 | air.convert.f.f16.u.i8 |
| 2 | air.convert.f.v4f32.u.v4i1 |
| 1 | air.read_texture_2d.v4f16 |
| 1 | air.convert.f.f16.u.i16 |
| 1 | air.sample_texture_2d.s.v4i32 |
| 1 | air.read_texture_2d_ms.s.v4i32 |
| 1 | air.sample_texture_3d.s.v4i32 |
| 1 | air.sample_texture_2d.u.v4i32 |
| 1 | air.read_texture_2d_ms.u.v4i32 |
| 1 | air.sample_texture_3d.u.v4i32 |
| 1 | air.sample_depth_2d.f32 |
| 1 | air.read_depth_2d_ms.f32 |
| 1 | air.sample_texture_2d.u.v4i16 |
| 1 | air.read_texture_2d_ms.u.v4i16 |
| 1 | air.convert.s.v3i32.f.v3f32 |
| 1 | air.fast_round.v3f32 |
| 1 | air.convert.u.v3i32.f.v3f32 |
| 1 | air.fast_floor.v3f32 |
| 1 | air.min.s.i16 |
| 1 | air.max.s.i16 |
| 1 | air.convert.f.v2f32.s.v2i32 |
| 1 | air.mix.f16 |
| 1 | air.fast_saturate.f32 |
| 1 | air.read_texture_2d.i16.u.v4i32 |
| 1 | air.gather_texture_2d.u.v4i32 |
| 1 | air.gather_texture_2d.v4f32 |
| 1 | air.convert.f.v2f32.s.v2i16 |
| 1 | air.fast_ceil.f32 |
| 1 | air.fast_floor.f32 |
| 1 | air.fmax.f16 |
| 1 | air.fmin.f16 |
| 1 | air.fmax.v4f16 |
| 1 | air.fmin.v4f16 |
| 1 | air.gather_texture_2d.v4f16 |
| 1 | air.convert.f.v2f32.u.v2i32 |
| 1 | air.atomic.local.load.i32 |
| 1 | air.atomic.local.add.u.i32 |
| 1 | air.sample_texture_2d.v4f16 |
| 1 | air.atomic.local.store.i32 |
| 1 | air.fast_fabs.v4f32 |
| 1 | air.fast_fmax.v2f32 |