Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bespoke validation functions returning TIMEDOUT error unexpectedly #1121

Open
LukeLongworth opened this issue Feb 26, 2024 · 10 comments
Open
Milestone

Comments

@LukeLongworth
Copy link
Contributor

Problem: I am getting a TIMEDOUT error with my bespoke validation function for an unknown reason. To try and diagnose it, I recreated the error in a very simple question:
image
image
Then at the PRT I just check whether ans1 = 1.

In this form, the question works exactly as intended, but when I un-comment the line that calls an integral, I get a TIMEDOUT error in the validation. This feels very strange to me. The only way I can recreate this error is by calling the defint function to integrate an exponential function with an argument of the form (constant*f(x)). I'm not even assigning values to a variable, I'm simply calling the function in the Question variables

Things that cause this to break:

  • int(e^(s*x),x,0,1)
  • int(%e^(s*x),x,0,1)
  • defint(e^(s*x),x,0,1)
  • int(%e^(s*x^2),x,0,1)
  • (s:1, int(e^(s*x),x,0,1)
  • int(e^(m*x),x,0,1)
  • int(e^(2*x),x,0,1)
  • laplace(e^(2*x),x,s)
  • assume(s>0); int(e^(x*ln(s)),x,0,1)

Things that don't cause this to break:

  • int(e^(s*x),x)
  • int(e^x,x,0,1)
  • laplace(e^x,x,s)
  • int(s*x^2,x,0,1)
  • assume(s>0); int(ln(s*x),x,0,1)
  • assume(s>0); int(s^x,x,0,1)
  • ev(subst([x=1],int(e^(s*x),x)) - subst([x=0],int(e^(s*x),x)),simp)
  • int(exp(s*x),x,0,1) (this confuses me the most)
  • assume(s>0); int(exp(x*ln(s)),x,0,1)

These issues do not persist when I call the problem function somewhere outside of the Question variables (e.g. in the Question text or General Feedback). I am not sure where to find the source code that calls bespoke validation functions, so I don't have any suggestions as to where the issue arises except that it seems to be about the defint function, sorry!

@sangwinc
Copy link
Member

@LukeLongworth I'm very sorry but I can't reproduce this on my test server! Can you email me your question and I'll try to break one of the older (live) servers.

Just to note that Maxima has an interactive integrator. Try the following on a desktop Maxima system

integrate(x^n,x);

It is possible this interactivity is causing the timeout.

@LukeLongworth
Copy link
Contributor Author

I've returned to this issue and have some updates:

Firstly, it doesn't seem to be defint after all, as I've discovered some extra functions that cause the issue:

  • int((sin(t)*e^(-2*t),t)
  • int((sinh(t)*e^(-2*t),t)
  • int((ln(t)*e^(-2*t),t)
    Even though the following do not cause the issue:
  • int(((e^(i*t) - e^(-i*t))/(2*i))*e^(-2*t),t)
  • int(((e^(t) - e^(-t))/2)*e(-2*t),t)

Secondly, this issue is persisting in STACK version 2024012900 in a different installation. Santiago kindly added me to an IDEMS test server so I could check, and I am observing the exact same behaviour, both when I import an existing question and create a new one. I've included this question (imported once from each server) below. I observe this this on both my work device and on my phone.

custom validation glitch.zip.zip

@sangwinc
Copy link
Member

@LukeLongworth, I can't reproduce the error, either on my development machine or on our public demo server
https://stack-demo.maths.ed.ac.uk/demo/
which is also running 2024012900. What value does your server have for the "timeout" in the STACK settings?
Perhaps a zoom call is needed to sort this all out?

@sangwinc
Copy link
Member

@LukeLongworth Since I can't reproduce this, and we've released a new version since it was opened I'm closing it. Please let me know if this is still an issue and I'll help fix it.

@LukeLongworth
Copy link
Contributor Author

@sangwinc I think the issue is still ongoing, but we only upgrade annually. If this is still an issue once we upgrade in January I'll let you know.

I didn't hear back from our IT team about "timeout" in the STACK settings. I'll chase that up and let you know what they say.

@sangwinc sangwinc added this to the 4.8.0 milestone Jul 23, 2024
@sangwinc sangwinc reopened this Jul 23, 2024
@sangwinc
Copy link
Member

sangwinc commented Nov 5, 2024

@LukeLongworth could you confirm if this is still and issue? I'd like to fix this before Nov 19th (next release) or close it!

@sangwinc
Copy link
Member

sangwinc commented Nov 6, 2024

@LukeLongworth I've just tried your example on my development setup with the release candidate code, and can't reproduce the problem. I'm going to bump this to the next release.

@sangwinc sangwinc modified the milestones: 4.8.0, 4.9.0 Nov 6, 2024
@LukeLongworth
Copy link
Contributor Author

Kia ora @sangwinc, I've just tried this again on version 4.7.0 and it's still persisting. I don't have the required access to check settings in the install, but I'm meeting with IT this afternoon and will bring this up then if we have time. Thank you for continuing to check this!

@EJMFarrow
Copy link
Collaborator

I managed to replicate this locally by including two of the offending functions in question variables. (Each on its own is fine.)

a:int(e^(s*x),x,0,1);
b:int(ln(t)*e^(-2*t),t);

validate_test(ex):= block(
   return("")
);

Oddly, upping the CAS timeout doesn't seem to fix it. I'll investigate further.

@EJMFarrow
Copy link
Collaborator

This appears to be to do with simplification. If you have a question with e.g. c:int(e^(s*x),x,0,1); in question variables, set 'question-level simplify to 'No' and attempt to save you will immediately get an error Condition in MACSYMA-TOP-LEVEL [or a callee]: INTERNAL-SIMPLE-ERROR: Value stack overflow.

By default, validation does not simplify and maxima falls over when it tries to process the question variables as part of the custom validation. A workaround is to include simp in the answer extra options but this may not be exactly what you want. @sangwinc - any thoughts?

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

No branches or pull requests

3 participants