どうしましょう…57.0kg(23:35)
16-Aug-2025の続き。-m32を付けてi686向けのコードとして、SSE/AVX対応にしたらどうなるのかな、というのが気になったので。Debian-13/amd64の動くCore i7-7700マシンでのテスト結果です。
・encode
3200 | 1600 | 700C | |
-O2 | 0m48.023s | 0m47.399s | 0m57.431s |
-O2 -mfpmath=sse -msse2 | 0m38.305s | 0m37.841s | 0m51.163s |
-O2 -mfpmath=sse -mssse3 | 0m38.418s | 0m37.774s | 0m47.701s |
-O2 -mfpmath=sse -msse4.2 | 0m35.870s | 0m35.263s | 0m45.792s |
-O2 -mfpmath=sse -mavx | 0m38.189s | 0m38.168s | 0m47.819s |
-O2 -mfpmath=sse -mavx2 | 0m38.121s | 0m38.071s | 0m47.660s |
・decode
3200 | 1600 | 700C | |
-O2 | 0m34.537s | 0m34.329s | 0m29.411s |
-O2 -mfpmath=sse -msse2 | 0m29.457s | 0m29.396s | 0m26.414s |
-O2 -mfpmath=sse -mssse3 | 0m29.493s | 0m29.368s | 0m26.366s |
-O2 -mfpmath=sse -msse4.2 | 0m29.465s | 0m29.381s | 0m19.824s |
-O2 -mfpmath=sse -mavx | 0m29.028s | 0m28.850s | 0m19.495s |
-O2 -mfpmath=sse -mavx2 | 0m28.988s | 0m28.840s | 0m19.517s |
最低でも-mfpmath=sse -msse2、可能なら-msse2の代わりに-msse4.2でしょうか。-msse4.2で十分性能は出ており、-mavxを使うまでもないかなと判断します。今更知ったのですが、-msse2等を使うなら-mfpmath=sseは必須です。amd64だと常に-mfpmath=sse扱いなので気にする必要は無いんですけどね。56.0kg(23:55)
リレーシールド(二個目)と電鍵接続用アタッチメント(二個目)を用意してyack-arduinoを動作させ、Iambic A/Bの挙動の違いを見てみました。
Iambic A | Iambic B |
---|---|
uaa@framboise:~/z/keyer-test$ ./keyer-test /dev/ttyU1 wait for device... device ready menu: a) do all tests 0) check dit/dah length 1) check simple timing 2) check dit/dah memory 3) check squeeze c) calibration x) exit -> a * dit/dah length dit: on=1184, off=1329, on/off=0.891 dah: on=3537, off=1328, on/off=2.663 dah/dit: 2.987 dit: total=2513, total/on=2.122, total/off=1.891 dah: total=4865, total/on=1.375, total/off=3.663 dah total/dit total=1.936 * simple dit 1- 1/ 4 . dit 1- 5/ 4 .. dah 1- 1/ 7 - dah 1- 8/ 7 -- * dit/dah memory dit on, dah 1/ 4 . dit on, dah 3/ 4 .- dit on, dah 5/ 4 .. dah on, dit 1/ 7 - dah on, dit 6/ 7 -. dah on, dit 9/ 7 -- * squeeze dit + dah 1/11 . dit + dah 3/11 .- dit + dah 10/11 .-. dit + dah 14/11 .-.- dit + dah 22/11 .-.-. dah + dit 1/11 - dah + dit 6/11 -. dah + dit 10/11 -.- dah + dit 18/11 -.-. dah + dit 22/11 -.-.- menu: a) do all tests 0) check dit/dah length 1) check simple timing 2) check dit/dah memory 3) check squeeze c) calibration x) exit -> x uaa@framboise:~/z/keyer-test$ |
uaa@framboise:~/z/keyer-test$ ./keyer-test /dev/ttyU1 wait for device... device ready menu: a) do all tests 0) check dit/dah length 1) check simple timing 2) check dit/dah memory 3) check squeeze c) calibration x) exit -> a * dit/dah length dit: on=1185, off=1329, on/off=0.892 dah: on=3541, off=1328, on/off=2.666 dah/dit: 2.988 dit: total=2514, total/on=2.122, total/off=1.892 dah: total=4869, total/on=1.375, total/off=3.666 dah total/dit total=1.937 * simple dit 1- 1/ 4 . dit 1- 5/ 4 .. dah 1- 1/ 7 - dah 1- 8/ 7 -- * dit/dah memory dit on, dah 1/ 4 .- dit on, dah 5/ 4 ..- dah on, dit 1/ 7 -. dah on, dit 8/ 7 -.- dah on, dit 9/ 7 --. * squeeze dit + dah 1/11 .- dit + dah 5/11 .-. dit + dah 12/11 .-.- dit + dah 16/11 .-.-. dah + dit 1/11 -. dah + dit 8/11 -.- dah + dit 12/11 -.-. dah + dit 20/11 -.-.- menu: a) do all tests 0) check dit/dah length 1) check simple timing 2) check dit/dah memory 3) check squeeze c) calibration x) exit -> x uaa@framboise:~/z/keyer-test$ |
やはりIambic Aでは長短点メモリはまったく効いておらず、squeeze動作についても違いが分かる結果になっています。10-Aug-2025の説明図を見ないと何が何やら、ではありますが。56.0kg(23:25)
ちょっと気になったので。テスト用のデータをdd if=/dev/urandom of=random.raw bs=1m count=256で作成し、drowe67/codec2をビルドしてtime ./c2enc <mode> random.raw random.outおよびtime ./c2dec <mode> random.out /dev/nullした際の時間(real)を計測です。OpenBSD-7.7/amd64ですが、Pentium G4600機で測っているのでSSE4.2止まり(AVX無し)です…
・encode
3200 | 1600 | 700C | |
-O0 | 2m23.976s | 2m22.630s | 3m16.137s |
-O1 | 0m55.181s | 0m54.347s | 1m25.363s |
-O2 | 0m50.797s | 0m49.830s | 0m59.965s |
-O3 | 0m52.575s | 0m51.862s | 1m1.740s |
-Ofast | 0m53.067s | 0m51.779s | 0m59.216s |
・decode
3200 | 1600 | 700C | |
-O0 | 1m47.708s | 1m48.063s | 1m4.096s |
-O1 | 1m4.849s | 1m3.801s | 0m35.929s |
-O2 | 0m59.696s | 0m59.621s | 0m33.935s |
-O3 | 1m0.608s | 1m0.561s | 0m34.160s |
-Ofast | 1m0.248s | 1m0.359s | 0m34.267s |
凝ったことをしなくても-O2で十分にパフォーマンスは出る、ということで良さそうです。55.7kg(21:20)
壊れたCH340Gを取り払って3.3V化したHT42B534なUSB-UARTアダプタを繋げているMassDuino UNO LC(22-Jun-2021)は、
という訳で、16MHz(external)/115200bpsでないと書き込めません。二台目のMassDuino UNO LCも多分ブートローダをいじっている気がするので、直さないといけない気がします。三台目は何もいじっていないのでこのままで良いはず。
久し振りにMassDuinoを引っ張り出して動かそうとすると、何もかも忘れているので本当に困りますね。SWDICE_mkII Pro v2.0も01-Nov-2020の日記を頼りにいじるとか、そんな状態です。
28-Jun-2025に一台目のCMOSバッテリを交換した工人舎ML6RL16A、二台目の処置も先日完了したので早速OSを入れて動かすことしました。試しにNetBSD/i386を入れてみたところ思っていたよりも重い感じがしたので、いつものようにOpenBSD/i386を入れてみたのですが…xenocara(X.org)が"glamor requires at least 128 instructions (64 reported)"というメッセージを表示して動きません。これは、modesetting doesn't fall back to shm if glamor_init() failsに示されるworkaround、20-modesetting.confを/usr/X11R6/share/X11/xorg.conf.dに配置することで回避できます。
それにしても、i386の終焉がだいぶ近づいているようです。chromiumもfirefoxもlibreofficeも、OpenBSD/i386向けのパッケージはありません。FreeBSD-15ではARMv7以外の32bitアーキテクチャは廃止とアナウンスが出ています。NetBSDはi386のサポートを止めないと思いたいですが…32bit機を道具として使えるようにするためのPC-UNIXは、減りつつあるようです。55.5kg(06:55)
TAM-KEYER102 | MX-K2 |
---|---|
uaa@framboise:~/z/keyer-test$ ./keyer-test /dev/ttyU1 wait for device... device ready menu: a) do all tests 0) check dit/dah length 1) check simple timing 2) check dit/dah memory 3) check squeeze c) calibration x) exit -> a * dit/dah length dit: on=1323, off=1401, on/off=0.944 dah: on=4046, off=1400, on/off=2.890 dah/dit: 3.058 dit: total=2724, total/on=2.059, total/off=1.944 dah: total=5446, total/on=1.346, total/off=3.890 dah total/dit total=1.999 * simple dit 1- 1/ 4 . dit 1- 5/ 4 .. dah 1- 1/ 7 - dah 1- 9/ 7 -- * dit/dah memory dit on, dah 1/ 4 .- dit on, dah 5/ 4 ..- dah on, dit 1/ 7 -. dah on, dit 9/ 7 --. * squeeze dit + dah 1/11 .- dit + dah 5/11 .-. dit + dah 13/11 .-.- dit + dah 17/11 .-.-. dah + dit 1/11 -. dah + dit 9/11 -.- dah + dit 13/11 -.-. dah + dit 21/11 -.-.- menu: a) do all tests 0) check dit/dah length 1) check simple timing 2) check dit/dah memory 3) check squeeze c) calibration x) exit -> x uaa@framboise:~/z/keyer-test$ |
uaa@framboise:~/z/keyer-test$ ./keyer-test /dev/ttyU1 wait for device... device ready menu: a) do all tests 0) check dit/dah length 1) check simple timing 2) check dit/dah memory 3) check squeeze c) calibration x) exit -> a * dit/dah length dit: on=1380, off=1398, on/off=0.987 dah: on=4139, off=1427, on/off=2.900 dah/dit: 2.999 dit: total=2778, total/on=2.013, total/off=1.987 dah: total=5566, total/on=1.345, total/off=3.900 dah total/dit total=2.004 * simple dit 1- 1/ 4 . dit 1- 5/ 4 .. dah 1- 1/ 8 - dah 1- 9/ 8 -- * dit/dah memory dit on, dah 1/ 4 .- dit on, dah 5/ 4 ..- dah on, dit 1/ 8 -. dah on, dit 9/ 8 --. * squeeze dit + dah 1/12 .- dit + dah 5/12 .-. dit + dah 13/12 .-.- dit + dah 17/12 .-.-. dah + dit 1/12 -. dah + dit 9/12 -.- dah + dit 13/12 -.-. dah + dit 21/12 -.-.- menu: a) do all tests 0) check dit/dah length 1) check simple timing 2) check dit/dah memory 3) check squeeze c) calibration x) exit -> x uaa@framboise:~/z/keyer-test$ |
結果の表示方法はまだまだ工夫が必要ですが、なんとなくチェックしている感はありますかね(実際、なんとなくではなくチェック自体はできているんですけど)。13/11だの9/12だのの意味が作っている身としても何が何やら…になってきているので、説明用にこんな画像を上げます。
短点(dit_on)とその後の空白(dit_off)を足したdit_totalの1/4を、一つの単位として単位で進めます。とりあえず、「時間枠」とでも名前を付けておきます。
という動きをしているつもりです。あと、同じ結果が何度も表示されても見づらいだけなので、前回と同じ結果となった場合はその操作の表示は省略します。例えば1/4の次に5/4となっている場合、2/4, 3/4, 4/4の操作結果は1/4と同じことを意味します。また、21/12と分子よりも分母が大きい部分については、1〜12の範囲がチェックの基本単位でありそこを超えた領域の結果であることを意図しています。
TAM-KEYER102とMX-K2はどちらもIambic-Bのような気がするので、Iambic-A/Bを切り替えられるYACK(-arduino)でどうなるか、見てみたいところです。そのためにはリレーシールドと、キーを接続するアタッチメントをもう一つ用意しないといけないんですよね…55.6kg(21:45)
13-Jul-2025の長短点メモリの有無を確認するだけでなく、どの時点からどの時点までの操作を長短点メモリの対象とするのかというのを調べてみるを実現すべく、keyer-testおよびkeyer-test-arduinoなるものを作っているところです。表題にある通りまだ途中なのでREADMEも全然整備してませんけど。
seeed studioのリレーシールド(の互換品)を装備したArduinoを使い、長点/短点パドルを操作したのと同じような指示をエレキーに出し、その結果(キー出力)を記録してPCに送り、あれこれ見てみようじゃないか…というものです。16bitタイマかつメモリの少ないAVR機でやるので、61440×64μsec/tick=3.93216秒の記録期間および分解能になってしまいますが、この程度の能力があれば取っ掛かりとしては十分でしょうか(16μsecの分解能も試していますが、記録期間が短すぎて使いにくいです)。
現時点ではまだ長点と短点の時間を測るしかできていません。それでも、TAM-KEYER102とMX-K2とで微妙に違う結果を出してくれます。
TAM-KEYER102 | MX-K2 |
---|---|
uaa@framboise:~/z/keyer-test$ ./keyer-test /dev/ttyU1 wait for device... device ready # relay_1: on=48, off=41 # relay_2: on=47, off=42 menu: 0) check dit/dah length c) calibration x) exit -> 0 # 1349 1426 1352 1425 1352 1425 1352 1425 # 4125 1425 4125 1425 4126 1424 4125 1426 * dit: on=1351, off=1425, on/off=0.948 * dah: on=4125, off=1425, on/off=2.895 * dah/dit: 3.053294 * dit: total=2776, total/on=2.055, total/off=1.948 * dah: total=5550, total/on=1.345, total/off=3.895 * dit total/dah total=1.999 menu: 0) check dit/dah length c) calibration x) exit -> x uaa@framboise:~/z/keyer-test$ |
uaa@framboise:~/z/keyer-test$ ./keyer-test /dev/ttyU1 wait for device... device ready # relay_1: on=48, off=41 # relay_2: on=47, off=42 menu: 0) check dit/dah length c) calibration x) exit -> 0 # 1381 1359 1380 1358 1380 1359 1380 1518 # 4140 1388 4140 1388 4140 1388 4140 1548 * dit: on=1380, off=1398, on/off=0.987 * dah: on=4140, off=1428, on/off=2.899 * dah/dit: 3.000000 * dit: total=2778, total/on=2.013, total/off=1.987 * dah: total=5568, total/on=1.345, total/off=3.899 * dit total/dah total=2.004 menu: 0) check dit/dah length c) calibration x) exit -> x uaa@framboise:~/z/keyer-test$ |
64μsecの分解能なのである程度の誤差があるとしても、TAM-KEYER102の
という点は気になります。dit total/dah total(あ、このメッセージは逆なので直さないと)…符号要素間の空白を含めた長点と短点の比率は2になっているので、ちょっとした味付けと考えるのが良いのでしょうか。
とりあえず、長短点の長さが取れるようになったので、あとはスクイーズ動作をした場合の解析をどう実装していくかということになります。それはそれとして、ここしばらくの間はこれにかかりっきりになってしまい、受信練習を完全にサボっています…練習を再開した時にボロボロの結果を見て心が折れやしないか心配です。56.9kg(06:50)