4
\$\begingroup\$

Suppose a challenger submits a code-golf challenge to do a particular task, together with test inputs. (That is, they've determined that, in order to be convinced that the code in an answer correctly performs that task, it must do the right thing when given each of those test inputs.) How should a challenger judge the code in an answer, if that code is so slow that attempts to run it on some of those test inputs times out?

I'm wondering how to judge this answer.

I see that questions were asked on meta some years ago, Can code-golf answers be too slow? and May they take a very long time?. I don't see that there's any such thing as "too slow for golf". Yes, it's allowed. My problem is how to judge code that takes too much time to verify.

\$\endgroup\$
8
  • 1
    \$\begingroup\$ The answer you're asking about has a link to "verify a few of the smaller test cases". Is working on those convincing enough for you? \$\endgroup\$ – xnor Jan 14 at 10:25
  • 2
    \$\begingroup\$ Some options that may help to convince you that an answer is correct, without necessarily being able to verify all test cases: (i) try smaller test cases if possible; (ii) read the explanation/commented code (or request it if not already provided); (iii) download the interpreter and run the code locally (won't time out like TIO does but could still be very slow). \$\endgroup\$ – Dingus Jan 14 at 10:28
  • \$\begingroup\$ It is indeed hard to verify a solution when it takes too long to run (the linked one can at least run small inputs, but there are even worse ones in the wild). In that case, we heavily depend on the explanation provided by the answerer, so that we can at least analyze and verify the algorithm. \$\endgroup\$ – Bubbler Jan 14 at 10:34
  • \$\begingroup\$ @xnor Trouble can come when an answer passes all test cases, but fails another case: I added 17 17 18 to my question's test suite because it showed a (now fixed) bug in the C entry. The 05AB1E entry times out even on that. \$\endgroup\$ – Rosie F Jan 14 at 10:35
  • \$\begingroup\$ @Dingus I gather that there's an interpreter osabie.py written in Python 3.4. Fine, I have Python 3.9. But where do I download the 05ab1e interpreter? I don't see it at libraries.io/github/Adriandmen/05AB1E or github.com/Adriandmen/05AB1E and Google isn't helping. Or, if an entire Git repo needs to be downloaded, I don't see how to do that, or how to build it once it's downloaded. \$\endgroup\$ – Rosie F Jan 14 at 11:42
  • 3
    \$\begingroup\$ While it isn't exactly a good policy, treating answers in good faith is usually the best approach. The vast majority of the time, answers will be able to demonstrate for a lower/smaller test case, as well as include an explanation which can help verify correctness, and otherwise, asking the answerer to provide some kind of verification/proof is a good first step, and escalating it beyond that (downvotes, flags, etc.) if the answerer can't show validity \$\endgroup\$ – caird coinheringaahing Jan 14 at 13:41
  • 1
    \$\begingroup\$ My understanding is that 05AB1E has been migrated from Python to Elixir, though the old Python interpreter (called '05AB1E (legacy)' on TIO) is still available. You can find osabie.py and instructions on how to use it here. For the newer Elixir version, see here. \$\endgroup\$ – Dingus Jan 14 at 23:00
  • \$\begingroup\$ The current policy is caused by there being more people want to post unworkably slow solution than to test-run the code. On the other hand that makes some foreign users who find it hard to write explanation have their answers deleted. \$\endgroup\$ – user202729 Jan 28 at 10:27

You must log in to answer this question.

Browse other questions tagged .