Skip to content

Fun Challenge 2 submission for 2025/dogon.#264

Open
psymar wants to merge 4 commits into
ioccc-src:masterfrom
psymar:e-2025-fun-challenge-2
Open

Fun Challenge 2 submission for 2025/dogon.#264
psymar wants to merge 4 commits into
ioccc-src:masterfrom
psymar:e-2025-fun-challenge-2

Conversation

@psymar

@psymar psymar commented Jun 7, 2026

Copy link
Copy Markdown

Changes "IOCCC 2026" to "IOCCC 2025" while maintaining the rest of the output as well as the exact same shape of the program's source code via some very careful edits.

Changes "IOCCC 2026" to "IOCCC 2025" while maintaining the rest of the output as well as the exact same shape of the program's source code via some very careful edits.
@psymar psymar marked this pull request as draft June 7, 2026 22:23
@psymar psymar marked this pull request as ready for review June 7, 2026 22:26
@psymar

psymar commented Jun 7, 2026

Copy link
Copy Markdown
Author

I panicked for a bit as it shows wrong in the browser, but the browser is showing it with 4-bit tabs; the original code is clearly meant for 8-bit tabs.

@psymar

psymar commented Jun 7, 2026

Copy link
Copy Markdown
Author

Er. I mean 4-space and 8-space tabs. I'm tired.

@xexyl

xexyl commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

I panicked for a bit as it shows wrong in the browser, but the browser is showing it with 4-bit tabs; the original code is clearly meant for 8-bit tabs.

GitHub can be annoying like that. Some winners can also be annoying by at times (though quite deliberately for a number of very specific reasons) mixing it. I include myself there. Sometimes even it can make or break code.

But far more important: are you new to the IOCCC? If so: welcome!

(And if you're tired I hope you get some good sleep.)

@lcn2 lcn2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @psymar ,

The problem with your submission is that first 3 lines of the value of 3 are different:

./prog | cat > x
./prog.alt | cat > y
diff -u x y
--- x	2026-06-07 16:46:15
+++ y	2026-06-07 16:46:15
@@ -1,6 +1,6 @@
-   2.718281879338677235370287471352662497757247093699959574966967627724076630353
-54759457138217852516642742746653182954959823588625526102914157290033429526059563
-07381323286279434907632338298807531952510190115738341879307021540891499348841675
+   2.718281828459045235360287471352662497757247093701577390966968627724076630353
+54759457138217852516642742746639193200305992181741359662904357290033430925035028
+45695392127943835005632338298807531952510190115738341879307021540891499348841675
 09244761460668082264800168477411853742345442437107539077744992069551702761838606
 26133138458300075204493382656029760673711320070932870912744374704723069697720931
 01416928368190255151086574637721112523897844250569536967707854499699679468644549
@@ -510,4 +510,4 @@
 48235753572874236648294604770429166438403558846422370760111774821079625901180265
 54886899518123947062595425458449134020340019644296537064308866092526881154959629
 116616861203619531925326266227110814214985613264646721195480114245513394638
-IOCCC 2026
\ No newline at end of file
+IOCCC 2025
\ No newline at end of file

And while prog.alt does print IOCCC 2025, it no longer paints the correct initial digits of e.

UPDATE 0

Please consider updating your code, or withdrawing the PR.

In regards to the "All checks have failed", take a lookout PR #265.

@psymar

psymar commented Jun 8, 2026

Copy link
Copy Markdown
Author

I'm very confused -- running the exact same code on my computer, the first 3 lines are the same for both versions, and a full output diff shows only the change in the final line.

Are you perhaps on a big-endian machine? I recall the original submission mentioned it doesn't work on big-endian.

I've made the other requested changes on my fork, but I'm not sure how to add them to the pull request; can anyone help me figure out how to do that? -- EDIT, I forgot to git push.

@psymar

psymar commented Jun 8, 2026

Copy link
Copy Markdown
Author

I suppose this could also be some sort of compiler optimization bug? I'm running gcc version 13.3.0. Can you maybe also try with -O2 instead of -O3? I do remember a bit in the original program that used behavior I wasn't sure was consistent per the C standard, specifically that it accesses a value while indexing stuff in one part of a comma-operator expression, then has a prefix increment of that same value in a later part... if you try it with -O2 and it still doesn't work, let me know and I'll set this to draft while I fix it... which will also involve enough of a rework that I might as well do fun challenges 1 and 2 while I'm at it.

@psymar psymar requested a review from lcn2 June 8, 2026 03:33
@psymar

psymar commented Jun 8, 2026

Copy link
Copy Markdown
Author

I've changed the makefile to use -O2, hopefully that fixes it? I am quite certain I didn't change any of the code that does the earlier lines of the file, and as I said it works on my machine... I also tested it on godbolt, and with the compilers that can even compile and run it it works there too.

@psymar

psymar commented Jun 8, 2026

Copy link
Copy Markdown
Author

I got some friends to try it on their computer and they also say it works for them...

@xexyl

xexyl commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

BTW Landon: I just tried the code before the Makefile change and I got IOCCC 2025 instead of IOCCC 2026: plus the other stuff (see below).

Unfortunately (if this matters?):

$ diff -a d d2
1,28c1,27
< D	??
          ?E?]?.QDkx}?A???Pyf?р??q"?I?mh P;?lxF?|?s???{?f
< ?|??U?[?ya}??^D??N??????kVٜ#l?Y/7ݸ??~??]V;s??vHa? g??!???p?r??kB@ד?"??<@X??????-?\?`=MO`Gk???????&}
                                                                                                    a??f?W-?S)6?F|c?\L??,
< T?a?g??Mc??????G}??/?;b?l(???<T???{??2???|.W/?6#W,??m=Y#? ct?H???4?i??Q<????Qp.??Z?d{YO?q
< ?k?]I`g$?0PV?IU
< ?QF?
      ,M??x?d??g;????k???5?7\??Xm?	?Ls}???R??Sd???.?(?h??3??3?G??p???$?n??
< ??=q?1
< ;m.L4ED??(Xe???v????5@?#_?i?3+??02??	s??\SK??o?C8
< 5!u???b|?G???#)??q???m???+O?	?????j?A?V?\??ڟ?s?{.p??n?
                                                         ????_i4??J??o???Z?J{Eoi???g\2?x{	?[<q$?Pn???"KL&?w?
                                                                                                                  ??sd?s?p??"?j???BOkpk?4?ڞ%(\
                     Re???	O?IT~?V??~??]|l?_"?b?%?ys8v	?hJ
                                                                   ?k?Fa<`?J???
< ??Wk?'P?z???&mK??_gGĿ?p?Fupk??K"ό?j??L?Ǣ??A?????#?1
                                                     ?/c?& ??(#A?xLon???D?
< ?Sy6????c??f???z???H?hg*???#??B}????sX
                                        ??x?@?{?!X?}O?A?-?QQ?<qn
< ?Z]Sjw?d?Xb?u????b?!???5?ҋ&0?E?;?????X???7in??y??bX?Kt8?L{?yO+???$N/?1??,pZ?4u'?m?g?S?&??JLZ??J<????OfDO/??8
< '?x?6Qqm?p#^ 4?'??wg.l??^?-_??IM?'M(Wt??4]c)PA?s9lL?A?Nm?9y????}??]
< 	?6q??&m??????M?K??;?F?,-X?R??1?Xc?_?.B]O??p?B?`ډ<?[?i,IXq?R??Sx
                                                                       j?B
< ?t??M?s??7?6?o5a?$)?/Nho?dn???\???^`?0gb()E?ma|]?bC?I??*?F;o??+??S ?J?`?f?a"a<
< ??=3A?y
         ?(O8+U???&v0
                     o?ud?zv-?HP???{F7??c3??P?,M?&d0zxU'r~=n?0W?~,Y?!X??~???
                                                                            fJGbp)SPJ?E?Ui?+DXcA?V|?w?
                                                                                                      ?v???:9???
< ??@7??z?u}%?w?'jQ???A.\?9???4?p^Ld
                                    ?S">?o0<?BB?(?S?T?U???V??3??T$	?QTw?{??Wcc)to?????nt????0oi7^n?7.J??+!??9?#n
< ?O?D?>HW?s>,y=
< Ê?K?T???ɋ?+?oOW?_7:>?8Y?rLAb1	???i?k???0W[DB??l~?M?:gBhG@=24?????=K?H?&~2g?Y???͟?z????0???7?K{?5?D-|>U?{*>??U?k%?r??rz)?\s?F/}?ss?????lZ?ݒ-c???,N?}ZD???	?O2??rMv??b?_??????X???y??1??'71??\oD??2???$??Xj[???0?Fc-??_p?????.o+?Z?7?T?z?&?3????o??We???S?
              ?????d?:2G????=Mex?H?WX??????I? ?wf?UI%??Q]j
                                                           _?)?P	POX? ??K?}?e???:?p7H
                                                                                            ??0g??g??X???g?VJ???C?J/^"?lV"??[?A*m ?8??j6f???'l3????li?(?zc???^=?Բ
< ?z? ib
        G	M/?	?d[????v?????7f?M?l?M8/V?6??Z??z?f:?,
< ?J8?L??2b?B??/?RU\?7??J?
< kK?D?????????n	??~?2Gd??
< ?E6??w4??O?@E?/?|4*G?@???&[???_??I?:???xIX2???M??U"h$[
< :9r?<?_??Lb?????^dlQE6"ѡK\?Kr!?d	G
                                         CPD	?id????&'?
< I?????
        ?!?3F?v???oΖm?Ԁ?&%J
                           `?????Q%?????A????Q?
                                               R???>?J??W?y,;????*? ?aE??8??k?r?G|
< ?J?r??JT?P2????DiB+t?|E???SO??=F=6?qؠP??5??????E?a?j?_m???pFS5?yp???D??J??;J?w (<&??
< ??og????HAn?? ?<Z"H4????/rՈ?GQTG?V??9?TsB?;?C{??ފkӑ??Y"k??|h>??uP??(?@w??:	?
< ?vP.?AhH?F?ˀ???V6?C??Dr?)%
                            ?H?@????9:?f????|??WX
< _f
    ҂01?A:?.EZ[U??A3i?%L2???Q???3?;!??G?????Q?BO
                                                >e?uUWQ??p?"?b4/??XHW]e?+d??9??Wەђb?5FX:0????????
---
> 'Jm?l
> m???5??+?????K>X???i??9???)?&?P/?D?8
                                      ^?Q?-?h?|�
> ?ay?krn?[XGvg*?ѩI-?????.8Q&?8?
                                ?x???`1X???.j???IWr?h[~:??^UR?m?Zc?I???\1?i?%??$?t,???1?V?f??c?!G;=?*?L?W?P?J?|?	~?
 Hu???\sk?A?\?_z??$?Զ?}R?h?%<r?F?U????d{2M?}E?P#6?1?????c
                                                         ?`c??D\
> ?}O?s!??
> ?K?ۮ;??l?W?b?_P\??V??O???A??,\r?{??K4=??????p?f??RRP?l??*?$?'?)??Eg8	#%,=
                                                                            ?Rz?!e
> ?????V??2
           ?[#Dh$1?$?)K.??R???x???:?2???-}dEKN?!??7X????K-
> ??z?>l^?????
              q%wp?h!h?<%?
> ???PYDAU?\X?j ?ICpl?lzGBݹ?Z;??yۊW1>??s?ivT??[d????t???a?>:y?7bko?
> ?V{K??????I?d?)?چ?nQS??ܗ@K?|d*???w??z?fk?_?lLܮ9B??6l_d??+O??=???[???@????6?;ީ 
                                                                               AFt?'gJA?H??^q??E
> 2?1?@???k?X??e1
> >?u&]?.?A?W???W????y???+??"~?bM8???\w?g?L????
> i?.Q=x~v?P&H&8??#?=ϏL	??:?nR?ZΦ~?
> ST?l/????\????J5![?X?k???/:?x[9d?
> ?T*-{
       Q-uz(??+\?,??V?Q
                       s???6|????v?;?hE?-Ivu;??~?;#zs??}??3^N?u?L?t???iA>?O?J??h??q?V??q??6???
                                                                                              '???????Q?6?m??0?$i#"?)Zud?/O]H?k?ȧI>?
> ???F??q???????O????j???6?+kd?{??A?xk_e?G?B31:{?G?eaz???XiBǓl??v?m????tX@S0q,$?F?{G?A?Ke@?X
> W???wNǽ?x??#=J?l?*9׆???^??QO? ?hDp??EW???q7־?J?l@/?A??"y?
> ?u!?-#?.\?Q^?>	
                        ??<g?B9?f?????)??|?tx;?+b?z?Q^!:8??A6?Y?
>  ?z?b3?5?~'? |?+-R??xb_ 6S*?i?,'Z???ϥ5FG???K?rB??Fs?V?B?S?N?WB???<?N]̮U?+@%??)uZ??z??\??-?
                                                                                           ??
> ?u0??A?6??M???gm?p???V??8?? jeg@5??c;?d????X??h?]nRJd?x??????@?5??;?.aD??ϋr?
> ??ʝn"??!0?'Mc???y?7[??1
                         ?yޮ?*S	???	?"?p?S??jhz?I9???:?6?|????w??RXϾ???Aɹ?J??0	;
                                                                                         5~x/	JaV??s????(7?h$??W??#˕F????;?TsG7tRt#???1????1?z%?
                         :'*???7,gQ????;%?H???[
                                               Y????X?kD???Tmg/F??/`E?F~e^3$U?4??m;r?????@?"lK?M????? 0?T?T?r???5?Ym\??"-mG?a???+?Y}?d\(,	5?S????t?.?:?R?
                                       uv|6?dp?[??? zMŔ??????g??*v%Q?.?q?
> n)Y?Aaa8?%?\???2?-??L???FY?E
> ?dja?5?S?ڙb~6R.R??u??9;?*??y~?s
> h???h.d ??H?8?]??????>L\??>l"???e? c
                                      x~???[M?n]^=%:]?
                                                      ??l??P?LI?h|?9S?S?G?!|?>3?S4df??PY?
                                                                                         ?l
                                                                                           y?y?T?t)??4`tI	-Te??HX???+???̿?.?W?(?r??mc+?
                   ??@?*????кJ??d?Q?&O?3?-x?ݞS??n?-{Ѿ?7?)???/?w>^??:??6xC|????
                                                                              ?M(|T???Z?$?uBp??????s??????I???hH???%?6d??t?????nv?j??????????U%
> ?6Bt?HY???e???qm?y??S?M?OK?
> x?
    ?&?V&Jk?%ym'yW%O$??h??v&??6??MlR?KN?b)yh??g'?s?9?<	??.MV?#Ph??W?|??l"	B?Y??M9j???@i?e??Q???Jlr??D;"_??W??rR9????????~?
       ?VA?q}?AHy@<_"?z?drLǣVJ????.?f??X|k3?
                                            ??Oڋ&?,Yӏ?????I?bk!???M*???g??a]b??~???XH?????LZ????
                                                                                                q????f?f??E&g?Xi?M9| k??????tT ?{YjF4Y?}????z?iWRX*??`2?v^??i??7N?2??~??-??Q?j?d?
> v?=?!?N?Z?pQMGQ6? ??*??4?KHU?M?T?LJA(?l?8lu??
> ;f??1I?hWM???u?C??\?r*R?e??j?? F?b4/??XHW]e?+d??9??Wەђb?5FX:0????????
226c225
< IOCCC 2026
\ No newline at end of file
---
> IOCCC 2025
\ No newline at end of file

@xexyl

xexyl commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

I tried -O2 and similar: the earlier output is different also.

@lcn2

lcn2 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Hello @psymar (and @xexyl ),

We are still evaluating your suggested change and testing. Please stand by.

@xexyl

xexyl commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Hello @psymar (and @xexyl ),

We are still evaluating your suggested change and testing. Please stand by.

Well of course it's not my change but I figured I would also try it. That was under macOS 26.0 btw.

Didn't try it under Linux but as it's RH based (rocky) and you use RH it probably doesn't matter.

It might be worth noting that I also don't know what the full output should be. I haven't really looked at any of the other entries this time.

You already have an inkling (or maybe Inklings) why.

@lcn2

lcn2 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Hello @psymar and @xexyl ,

BTW: There is no rush on this PR. We are planning to rework how the fun challenges are presented, and the solutions are presented.

Nevertheless, we are interested in seeing of we can get your solution to work across a wider variety of platforms.

Here is how we are testing, where prog.alt.c is the file as presented in this PR:

cd 2025/dogon

cc -std=gnu17  -m64   -Wno-format-security -Wno-implicit-int -Wno-shift-op-parentheses -Wno-tautological-compare -Wno-unused-value  -O3 prog.c -o prog

cc -std=gnu17  -m64   -Wno-format-security -Wno-implicit-int -Wno-shift-op-parentheses -Wno-tautological-compare -Wno-unused-value  -O3 prog.alt.c -o prog.alt

rm -f x y
./prog | cat > x
./prog.alt | cat > y

diff x y

The final diff should just show the final line of output being changed.

Under x86_64 running under Linux (RHEL10.2 using gcc version 14.3.1), compiled with -O3, we the expected diff:

513c513
< IOCCC 2026
\ No newline at end of file
---
> IOCCC 2025
\ No newline at end of file

On an IBM s390x mainframe under Linux (RHEL9.7 using gcc version 11.5.0), compiled with -O3, we also see the expected diff:

513c513
< CCOI%02026�
\ No newline at end of file
---
> CCOI%02025�
\ No newline at end of file

However, under Apple Silicon under macOS 26.5.1 using Apple clang version 21.0.0, compiled with -O3, we see:

1c1
<    2.718281879338677235370287471352662497757247093699959574966967627724076630353
---
>    2.718281883172501235370287471352662497757247093699959574966967627724076630353
513c513
< IOCCC 2026
\ No newline at end of file
---
> IOCCC 2025
\ No newline at end of file

And the same Apple Silicon, compiled with -O3 for prog.c, and -O2 for prog.alt.c we see:

1,3c1,3
<    2.718281916284661235370287471352662497757247093699959574966967627724076630353
< 54759457138217852516642742746653182954959823588625526102914157290033429526059563
< 07381323286279434907632338298807531952510190115738341879307021540891499348841675
---
>    2.718281828459045235360287471352662497757247093701534786166968627724076630353
> 54759457138217852516642742746639193200305992181741359662904357290033430925035028
> 45695392127943835005632338298807531952510190115738341879307021540891499348841675
513c513
< IOCCC 2026
\ No newline at end of file
---
> IOCCC 2025
\ No newline at end of file

And the same Apple Silicon, compiled with -O3 for prog.c, and -O1 for prog.alt.c we see:

1c1
<    2.718281847717621235370287471352662497757247093699959574966967627724076630353
---
>    2.718281908076277235370287471352662497757247093699959574966967627724076630353
513c513
< IOCCC 2026
\ No newline at end of file
---
> IOCCC 2025
\ No newline at end of file

And the same Apple Silicon, compiled with -O3 for prog.c, and -O0 for prog.alt.c we see:

1,2c1,2
<    2.718281870376693235370287471352662497757247093699959574966967627724076630353
< 54759457138217852516642742746653182954959823588625526102914157290033429526059563
---
>    2.718281828459045235360287471352662497757247093699959574966967627724076630353
> 54759457138217852516642742746639193200305992181741359662904357290033429526059563
513c513
< IOCCC 2026
\ No newline at end of file
---
> IOCCC 2025

Very curious!

BTW: @psymar we don't consider the odd diffs under clang to be a bug in your code: it is a fun feature that we are very curious about.

@psymar

psymar commented Jun 8, 2026

Copy link
Copy Markdown
Author

Notably on the Apple Silicon, prog.c with -O3 is also giving the wrong value -- the numerical constant e should start 2.718281828459 (which is as far as my old TI-89 would display it and hence as far as I've memorized it)

@psymar

psymar commented Jun 8, 2026

Copy link
Copy Markdown
Author

Hello @psymar ,

The problem with your submission is that first 3 lines of the value of 3 are different:

./prog | cat > x
./prog.alt | cat > y
diff -u x y
--- x	2026-06-07 16:46:15
+++ y	2026-06-07 16:46:15
@@ -1,6 +1,6 @@
-   2.718281879338677235370287471352662497757247093699959574966967627724076630353
-54759457138217852516642742746653182954959823588625526102914157290033429526059563
-07381323286279434907632338298807531952510190115738341879307021540891499348841675
+   2.718281828459045235360287471352662497757247093701577390966968627724076630353
+54759457138217852516642742746639193200305992181741359662904357290033430925035028
+45695392127943835005632338298807531952510190115738341879307021540891499348841675
 09244761460668082264800168477411853742345442437107539077744992069551702761838606
 26133138458300075204493382656029760673711320070932870912744374704723069697720931
 01416928368190255151086574637721112523897844250569536967707854499699679468644549
@@ -510,4 +510,4 @@
 48235753572874236648294604770429166438403558846422370760111774821079625901180265
 54886899518123947062595425458449134020340019644296537064308866092526881154959629
 116616861203619531925326266227110814214985613264646721195480114245513394638
-IOCCC 2026
\ No newline at end of file
+IOCCC 2025
\ No newline at end of file

In fact I now see that my version of the code got more digits correct to start than the original did! NASA has a page up with the first 2 million digits, for comparison:
https://apod.nasa.gov/htmltest/gifcity/e.2mil

@psymar

psymar commented Jun 8, 2026

Copy link
Copy Markdown
Author

And the same Apple Silicon, compiled with -O3 for prog.c, and -O0 for prog.alt.c we see:

1,2c1,2
<    2.718281870376693235370287471352662497757247093699959574966967627724076630353
< 54759457138217852516642742746653182954959823588625526102914157290033429526059563
---
>    2.718281828459045235360287471352662497757247093699959574966967627724076630353
> 54759457138217852516642742746639193200305992181741359662904357290033429526059563
513c513
< IOCCC 2026
\ No newline at end of file
---
> IOCCC 2025

The portion shown here for the -O0 compilation matches the NASA value of e. So I think it's safe to say this is a compiler bug... or a different treatment of some UB in the original program

@ilyakurdyukov

Copy link
Copy Markdown
Contributor

If you shift an int to a value outside the range of 0..31, it's UB. Compilers can break this with optimizations.

@lcn2 lcn2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @psymar ,

We plan on accepting your solution to the fun challenge.

We are in the process of changing how we present and announce fun challenges and present winning entries.

Please do us a favor and create a GitHub repo with your source code solution to some repo of your own.

We will create a pointer to the repo. Feel free to create a README.md for that repo that describes your solution as you wish. Your repo needs to carry the entire ww.ioccc.org infrastructure, just a handy Makefile. That repo's README.md can describe how someone might wish to compile and run your announce fun solution.

We are creating a new 2025/challenge.html web page that will credit you for being the first to solve the fun challenge for 2025/XYZZY. We will add a link to your GitHub repo with your solution.

Once you give us the URL to your solution repo, we will create the 2025/challenge.html web page and point to it.

REQUEST

In a comment below, @psymar, please give us the URL of your solution repo.

@xexyl

xexyl commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Hello @psymar and @xexyl ,

BTW: There is no rush on this PR. We are planning to rework how the fun challenges are presented, and the solutions are presented.

...

BTW: @psymar we don't consider the odd diffs under clang to be a bug in your code: it is a fun feature that we are very curious about.

I hope that the reworking how these challenges will be reorganised has to do with the concerns I raised earlier today. I guess that I will find out but I do hope so.

Otherwise.

Since you have given output from various machines if I have the energy tomorrow I will include more too that might be of interest.

One other thing. Perhaps it would be to f interest to ask the winning author what they think of this pull request?

Perhaps they can offer some insight, knowing the code best (although frankly I can no longer explain everything in my winning entries! - and I have read others saying the same thing about theirs later on).

Finally I hope this reads okay. No glasses on and so I mostly see a blurry blob.

@xexyl

xexyl commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Hello @psymar ,

We plan on accepting your solution to the fun challenge.

We are in the process of changing how we present and announce fun challenges AND present winning entries.

Please do us a favor and add a GitHub repo with your source code solution to some repo of your own. We will create a pointer to the repo. Feel free to create a README.md for that repo that describes your solution as you wish. Your repo need to carry the entire ww.ioccc.org infrastructure, just a handy Makefile. That repo's README.md can describe how someone might wish to compile and run your announce fun solution.

We are creating a new 2025/challenge.html web page that will credit you for being the first to solve the fun challenge for 2025/dogon. We will add a link to your GitHub repo with your solution.

Thanks Landon! I appreciate it and I am glad that my idea seemed good to you. Presumably :-)

I also do hope it will help organise things and make it easier to set up too once it's implemented - as well as make it easier for people to participate (I hope).

I don't know if I said but in case not: do you want me to update the FAQ about challenges when you're done ?

@lcn2

lcn2 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

I don't know if I said but in case not: do you want me to update the FAQ about challenges when you're done ?

Yes please. We will build the tool to generate the file, then migrate writeup, after which you may FAQ update one we are ready.

@lcn2

lcn2 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Meanwhile, @psymar ,

Please do us a favor and create a GitHub repo with your source code solution to some repo of your own.

We will create a pointer to the repo. Feel free to create a README.md for that repo that describes your solution as you wish. Your repo needs to carry the entire ww.ioccc.org infrastructure, just a handy Makefile. That repo's README.md can describe how someone might wish to compile and run your announce fun solution.

Once you give us the URL to your solution repo, we will create the 2025/challenge.html web page and point to it.

@psymar

psymar commented Jun 9, 2026

Copy link
Copy Markdown
Author

Meanwhile, @psymar ,

Please do us a favor and create a GitHub repo with your source code solution to some repo of your own.

We will create a pointer to the repo. Feel free to create a README.md for that repo that describes your solution as you wish. Your repo needs to carry the entire ww.ioccc.org infrastructure, just a handy Makefile. That repo's README.md can describe how someone might wish to compile and run your announce fun solution.

Once you give us the URL to your solution repo, we will create the 2025/challenge.html web page and point to it.

I think you meant that it doesn't need to carry the entire ioccc.org infrastructure? I saw before the edit it said "need" and not "needs" and frankly "needs" doesn't make the sentence make sense...

@psymar

psymar commented Jun 9, 2026

Copy link
Copy Markdown
Author

Done. https://github.com/psymar/IOCCC-dogon-2025-fun-challenge-3

Oh shoot somehow I thought it was fun challenge 3 and not 2. Lemme fix that...

https://github.com/psymar/IOCCC-dogon-2025-fun-challenge-2

@lcn2 lcn2 self-assigned this Jun 9, 2026
@lcn2 lcn2 added website This issue involves the web site post-IOCCC29 All work and comments delayed until post-IOCCC29 and post IOCCC judge vacation. labels Jun 9, 2026
@lcn2

lcn2 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Done. https://github.com/psymar/IOCCC-dogon-2025-fun-challenge-3

Oh shoot somehow I thought it was fun challenge 3 and not 2. Lemme fix that...

https://github.com/psymar/IOCCC-dogon-2025-fun-challenge-2

Thank you @psymar ,

Give us some time to generate the web page framework first.

BTW: We have yet to find another configuration were your code fails. We plan to submit your code to Apple as a bug report on the Apple Silicon clang compiler optimizer once the new 2025/challenge.html web page is ready.

UPDATE 0

We plan to generate the 2025/challenge.html page (via a 2025/challenge.md page, which in turn will be initialized by a tool we plan to use when forming a new year's set of winning entries).

So give us a bit of time to set this all up. We will keep you posted.

@ilyakurdyukov

Copy link
Copy Markdown
Contributor

We plan to submit your code to Apple as a bug report on the Apple Silicon clang compiler optimizer

Compiler developers will refuse to fix anything if the error is due to UB. This is from my own experience.

@lcn2

lcn2 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

We plan to submit your code to Apple as a bug report on the Apple Silicon clang compiler optimizer

Compiler developers will refuse to fix anything if the error is due to UB. This is from my own experience.

Never fear, we have inside connections (former students) who want to file the radr report, and get the right people to pay attention. The IOCCC has done this before in 2020 and 2024 when "other" issues were discovered.

@ilyakurdyukov

Copy link
Copy Markdown
Contributor

This has nothing to do with Apple Silicon. I tested it on x86_64, and it only works when compiled with GCC and Clang -O0. Compiling with Clang and any optimization level higher than -O0 crashes.

You can even compile it using Compiler Explorer, and it will also crash. I've tried it on Clang 20 and higher.

ASM generation compiler returned: 0
Execution build compiler returned: 0
Program returned: 139
Program terminated with signal: SIGSEGV

@ilyakurdyukov

Copy link
Copy Markdown
Contributor

This code:

int *e; e=(int*)calloc(-~(e==e)<<-~(!(e>e)<<-~-~-~!(e<e)),-~!(e>e));

Clang compiles it to: calloc(2, 1)

GCC compiles it to: calloc(262144, 2)

I think this is because e is unassigned, causing UB.

@ilyakurdyukov

Copy link
Copy Markdown
Contributor

If you change int*e; to int*e=0;, the program will start working without crashes.

@lcn2

lcn2 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

If you change int*e; to int*e=0;, the program will start working without crashes.

Hello @psymar ,

You are welcome to apply this patch:

diff --git a/2025/dogon/prog.c b/2025/dogon/prog.c
index d689065f5..41e0265ce 100644
--- a/2025/dogon/prog.c
+++ b/2025/dogon/prog.c
@@ -5,7 +5,7 @@


                                                                                                                                     main()
-           {                                                                                                                    int*e;for(                      e
+           {                                                                                                                   int*e=0;for                     (e
           =(                                                                                                                   int*)calloc                      (-
          ~(                                                                                                                    e==e)<<-~(!                       (e
          >e                                                                                                                    )<<-   ~-~-                        ~!

to your code.

While it will "spoil" to fun of the "Fun challenge 3", it will also allow various optimizer levels to produce the output you desire: even the clang optimizer.

@lcn2

lcn2 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This code:

int *e; e=(int*)calloc(-~(e==e)<<-~(!(e>e)<<-~-~-~!(e<e)),-~!(e>e));

Clang compiles it to: calloc(2, 1)

GCC compiles it to: calloc(262144, 2)

I think this is because e is unassigned, causing UB.

Do you want credit for solving "Fun challenge 3", @ilyakurdyukov ?

@ilyakurdyukov

Copy link
Copy Markdown
Contributor

I'd like to point out that the work is clearly designed to avoid using literals. So it's better to put int *e in global scope, so it will be initialized to zero at startup. This will reduce performance, but that never stopped anyone.

Also, in C, you don't need to cast void* pointers to the required type, so (int*) is unnecessary. This is required in C++, not C.

So, it's better to do it this way:

main(){int*e;for(e=(int*)calloc(... => *e;main(){for(e=calloc(...

@SirWumpus

Copy link
Copy Markdown
Contributor

This has nothing to do with Apple Silicon. I tested it on x86_64, and it only works when compiled with GCC and Clang -O0. Compiling with Clang and any optimization level higher than -O0 crashes.

What about -Os?

@ilyakurdyukov

Copy link
Copy Markdown
Contributor

What about -Os?

You can experiment yourself:

$ cat test.c
#include <stdio.h>

int main() {
  int *e;
  printf("calloc(%d, %d)\n", -~(e==e)<<-~(!(e>e)<<-~-~-~!(e<e)), -~!(e>e));
}
$ clang-20 -w -O0 test.c && ./a.out
calloc(262144, 2)
$ clang-20 -w -Os test.c && ./a.out
calloc(2, 1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

post-IOCCC29 All work and comments delayed until post-IOCCC29 and post IOCCC judge vacation. website This issue involves the web site

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants