Skip to content

dasLLAMA library on any x86-64: half converts without F16C, dasllama_core, PCM stream API - #4229

Merged
borisbat merged 7 commits into
masterfrom
aleksisch/dasllama-speech
Oct 12, 2026
Merged

borisbat merged 7 commits into
masterfrom
aleksisch/dasllama-speech

Conversation

@aleksisch

@aleksisch aleksisch commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Makes examples/dasLLAMA/library usable as a native speech library for games: it runs on any x86-64 CPU and links no decoder.

  1. jit: one function picks the intrinsic tables of the target - get_intrinsic holds the target dispatch once; no change in emitted code.
  2. jit: float16 converts compile without hardware half converts - without F16C, half converts fell back to the interpreter and a -lib library died with "null function"; build_fp_convert now converts in IR there.
  3. jit: fp16 operators compile without hardware half converts - the fp16 operators use it too; g_lattice_fp16_ops_native is gone, operator checks live in isCompareOp2 / get_float_arith_op.
  4. dasLLAMA: split out dasllama_core without the file decoders - no miniaudio, HRTF or stb_image; dasllama/dasllama stays core plus the decoders.
  5. dasLLAMA: the library example streams PCM - asr_listen / asr_feed / asr_listen_end, tts_speak / tts_pcm; the hosts do their own WAV I/O.
  6. dasLLAMA: the examples that decode nothing require dasllama_core

@aleksisch
aleksisch force-pushed the aleksisch/dasllama-speech branch 8 times, most recently from 90df8d8 to 070464c Compare October 11, 2026 17:00
has_intrinsic and lookup_intinsic each repeated the same ten gated
table lookups. get_intrinsic now holds the target dispatch once, and
both call it. No change in emitted code.
Without F16C, half converts fell back to the interpreter, and a -lib
library died with "null function". build_fp_convert now converts in IR
there (ports of das_float16_to_float / das_float_to_float16).
The fp16 operators convert through build_fp_convert, so
g_lattice_fp16_ops_native is gone. The emitter checks operators in one
place: isCompareOp2 and get_float_arith_op.
dasllama_core is the engine without the audio and image file decoders,
so a program that hands it samples links no miniaudio, HRTF or
stb_image. dasllama/dasllama stays core plus the decoders. The WAV
encoders, pure daslang, move to dasllama_wav in core.
A game passes samples, not files. The library takes them through
asr_listen / asr_feed / asr_listen_end and speaks into memory through
tts_speak / tts_pcm; asr_transcribe and tts_say are gone, and the hosts
do their own WAV I/O. It requires dasllama_core.
speak, run, chat and wasm/dlim_config read no audio or image file, so
they no longer need the audio and stbimage modules.
The JIT simulates unfused, so the runner's semantic hash differs from an
interpreted run's. Building the -exe tool or running lint under -jit
restamped the cache and emptied it, and the interpreted lint chunks that
ran next emptied it again. A JIT compile now neither checks nor stamps the
cache, and a -jit run lints without it (jit_enabled(), after
is_standalone_exe() so the exe never asks), so it never reads entries an
older rule set wrote.
@aleksisch
aleksisch force-pushed the aleksisch/dasllama-speech branch from 070464c to 989dcf0 Compare October 12, 2026 08:46
@aleksisch
aleksisch requested a review from borisbat October 12, 2026 10:38
@borisbat
borisbat merged commit defbb41 into master Oct 12, 2026
45 checks passed
@borisbat
borisbat deleted the aleksisch/dasllama-speech branch October 12, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants