#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long tt;
  cin >> tt;
  while (tt--) {
    long long n;
    cin >> n;
    vector<long long> v(n);
    for (long long &i : v) cin >> i;
    long long ans = 1;
    long long prev = 1e18;
    vector<long long> level(n + 1, 0);
    level[0] = 1;
    for (long long i = 1; i < n; ++i) {
      if (v[i] < prev) {
        if (level[ans - 1] > 0) {
          level[ans - 1]--;
        } else {
          level[ans]--;
          ans++;
        }
      }
      level[ans]++;
      prev = v[i];
    }
    cout << ans << "\n";
  }
  return 0;
}
