Fun Challenge 2 submission for 2025/dogon.#264
Conversation
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.
|
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. |
|
Er. I mean 4-space and 8-space tabs. I'm tired. |
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.) |
There was a problem hiding this comment.
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 fileAnd 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.
|
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. |
|
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. |
|
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. |
|
I got some friends to try it on their computer and they also say it works for them... |
|
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???Tڻ?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 |
|
I tried |
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. |
|
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 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 yThe 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 fileOn 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 fileHowever, 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 fileAnd the same Apple Silicon, compiled with -O3 for 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 fileAnd the same Apple Silicon, compiled with -O3 for 1c1
< 2.718281847717621235370287471352662497757247093699959574966967627724076630353
---
> 2.718281908076277235370287471352662497757247093699959574966967627724076630353
513c513
< IOCCC 2026
\ No newline at end of file
---
> IOCCC 2025
\ No newline at end of fileAnd the same Apple Silicon, compiled with -O3 for 1,2c1,2
< 2.718281870376693235370287471352662497757247093699959574966967627724076630353
< 54759457138217852516642742746653182954959823588625526102914157290033429526059563
---
> 2.718281828459045235360287471352662497757247093699959574966967627724076630353
> 54759457138217852516642742746639193200305992181741359662904357290033429526059563
513c513
< IOCCC 2026
\ No newline at end of file
---
> IOCCC 2025Very 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. |
|
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) |
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: |
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 |
|
If you shift an |
There was a problem hiding this comment.
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.
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. |
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 ? |
Yes please. We will build the tool to generate the file, then migrate writeup, after which you may FAQ update one we are ready. |
|
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... |
|
Done. Oh shoot somehow I thought it was fun challenge 3 and not 2. Lemme fix that... |
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 UPDATE 0We plan to generate the So give us a bit of time to set this all up. We will keep you posted. |
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. |
|
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. |
|
This code:
Clang compiles it to: GCC compiles it to: I think this is because |
|
If you change |
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 " |
Do you want credit for solving "Fun challenge 3", @ilyakurdyukov ? |
|
I'd like to point out that the work is clearly designed to avoid using literals. So it's better to put Also, in C, you don't need to cast So, it's better to do it this way:
|
What about |
You can experiment yourself: |
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.