#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long int n) {
  if (n == 1) {
    return false;
  }
  for (long long int i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int binarySearch(int arr[], int l, int r, int x) {
  if (r >= l) {
    int mid = l + (r - l) / 2;
    if (arr[mid] == x) return mid;
    if (arr[mid] > x) return binarySearch(arr, l, mid - 1, x);
    return binarySearch(arr, mid + 1, r, x);
  }
  return -1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int vertex[n];
    for (int i = 0; i < n; i++) {
      cin >> vertex[i];
    }
    int height = 1;
    int free_child = 0;
    int check = 1;
    for (int i = 1; i < n; i++) {
      if (vertex[i] > vertex[i - 1]) {
        free_child++;
      } else {
        check--;
        if (!check) {
          height++;
          check = free_child;
          free_child = 1;
        } else {
          free_child++;
        }
      }
    }
    cout << height << "\n";
  }
}
