I am trying to create a binary dump format for sped up compile times with luahbtex -ini and mylatexformat.
However, depending on certain packages being loaded, I get an error I can't make sense of.
In my personal research, this is a follow-up development on https://tex.stackexchange.com/a/690435/53868, but needs to be investigated on its own.
Setup
I am running
$ tex --version
TeX 3.141592653 (TeX Live 2023)
mwe.tex
\documentclass[UKenglish]{scrbook}
\usepackage{babel}
\usepackage{lipsum}
% \usepackage{pgfplots}
% \usepackage{amsmath}
% \usepackage{siunitx}
% \usepackage{geometry}
\begin{document}
\title{Lualatex Binary Dumping}
\subtitle{Is dumping with lualatex dumb?}
\subject{Case Studies}
\date{\today}
\maketitle{}
\lipsum[1-20]
\end{document}
commands to run
luahbtex -ini "&lualatex" mylatexformat.ltx mwe
Expected behaviour
A binary dump mwe.fmt is created alongside the m mwe.tex file, which then can be used in further lualatex runs:
lualatex -fmt=mwe mwe
Observed behaviour
- Running the commands from section Setup on file
mwe.texproduces the error message
while commenting out the line(/usr/local/texlive/2023/texmf-dist/tex/latex/l3backend/l3backend- luatex.def))) ! Use of \??? doesn't match its definition. <argument> \??? ! LaTeX Error: Access to an entry beyond an array's bounds. l.208 }? ! Emergency stop. <argument> ???
! LaTeX Error: Access to an entry beyond an array's bounds. l.208 }% \usepackage{lipsum}makes the binary dumping process run through without error. The issue seems related to
lipsumorl3backend-luatex. - The mwe compiles fine with just
lualatex mwe.tex, so the issue is not a general incompatibility between lualatex andlipsum. - Commenting in other packages, which use latex3 has the memory dump also run sucessfully.
Question
I just happened to notice this behaviour with the lualatex package, and I do not understand it. I do not care so much for the lualatex package, but I want to understand what is happening there, as the same problem could arise with other packages I want to use in the future. Thus, my questions are:
- Is this a bug exclusively with
lipsumandluahbtexor - is this behaviour rooted more deeply?
- What is going wrong here anyway, and how can I improve my debugging skills for error messages like this?
- Should I continue considering creating luahbtex formats files, or is the process too error-prone in general?
\everyjobwhen the new format is used. – David Carlisle Jul 12 '23 at 09:51\directluain some package and re-instating everything in the right order is tricky, adapting any particular package to work here isn't that hard but a general solution that will catch any package with no package-specific changes is hard (and as far as I know, has not been done) – David Carlisle Jul 12 '23 at 10:34\everyjobyou need to reload the font (without re-doing all the tex setup and getting errors from already defined commands) doing that without specific knowledge of fontspec isn't really possible.or you modify so that\setmainfontand friends delay all their setup till atbegindocument so they do nothing in the dumped format and act in the document, but if you delay everything, then you get no speed benefit from dumping a custom format – David Carlisle Jul 12 '23 at 10:38