Is there any polynomial time algorithm for a restricted EXP-time problem? Let we fix $&lt;T&gt;$ and $w$, where $&lt;T&gt;$ is its binary representation of a Turing machine and $w$ is input.

We want to check if $T$ doesn't halt over $w$ before $2^{|w|}$ steps. A trivial solution is to use a universal Turing machine which simulates $T$ on $w$ and counts its steps, but this method uses exponential time.

I wish to know do we have any polynomial time algorithm to check this for the fixed Turing machine and input?

If we had a high-level program or pseudo code, then we had the possibility to analyze it and figure out the time complexity without simulation. But by Rice theorem, we know that it is not possible to understand the behaviour of a Turing machine using its binary representation string. So it seems impossible to have a Turing machine which runs in polynomial time and understand that $T$ doesn't halt less than $2^{|w|}$ steps even for a fixed $T$ and $w$. I don't know how to prove it. 

Edit (In order to be more clear about inputs and outputs):

There are two possible ways to think of it:


We want a Turing machine $M$ that runs in polynomial time over its empty tape and outputs 0 if $T$ halts over $w$ before $2^{|w|}$ steps and outputs 1 otherwise.
We want a Turing machine $M$ that runs in polynomial time over input $&lt;T&gt;w$ and outputs 0 if $T$ halts over $w$ before $2^{|w|}$ steps and outputs 1 otherwise. It's not important for us that what is $M$ output for other inputs.


I believe there is no such $M$ since it is not possible to understand what is a Turing machine doing without simulation of its steps. If such $M$ exists, then it is understanding somehow how $T$ acts on $w$ without simulation of $T$ on $w$. Of course for special cases like pseudo-code, we can estimate the running time. But the $T$ which we fix is not always a pseudo-code.

Edit 2: In order to fix the point Ariel mentioned in his answer,

We want a Turing machine $M$ with the second formulation that works correctly as we stated (it understand T takes exponential time running its input) for two inputs $&lt;T&gt;w_1$ and $&lt;T&gt;w_2$.
Your first formulation isn't very useful, as either the machine which simply writes $0$ on its tape (without putting in any effort) or the one which writes $1$, satisfy your condition. Fixing both $T,w$ means you have only one question at hand, and not a computational task we can reason about in terms of the amount of resources require to handle it. In that case, a simple yes or no consists as a valid answer, and we can output it in constant time.

In your second formulation, you're asking whether the language

$L=\{(\langle M \rangle,w)| \text{$M$ halts on $w$ within $2^{|w|} steps$}\}$

is decidable in polynomial time? The answer is no, since $L$ is hard (under polynomial time reductions) for the class $\mathsf{DTIME\left(2^n\right)}$. This means that if $L\in P$ then $\mathsf{P=DTIME\left(2^n\right)}$, contradicting the time hierarchy theorem.